)>}]
شركة التطبيقات المتكاملة لتصميم وبرمجة البرمجيات الخاصة ش.ش.و.
Integrated Applications Programming Company
Home » Code Library » Site (Ia.Statistics.Cl.Model)

Public general use code classes and xml files that we've compiled and used over the years:

Site support class for Optical Fiber Network (OFN) data model.

    1: using System.Collections.Generic;
    2: using System.Data;
    3: using System.Linq;
    4:  
    5: namespace Ia.Statistics.Cl.Model
    6: {
    7:     ////////////////////////////////////////////////////////////////////////////
    8:  
    9:     /// <summary publish="true">
   10:     /// Site support class for Optical Fiber Network (OFN) data model.
   11:     /// </summary>
   12:     /// 
   13:     /// <remarks> 
   14:     /// Copyright © 2024-2025 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
   15:     ///
   16:     /// This library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
   17:     /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
   18:     ///
   19:     /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
   20:     /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
   21:     /// 
   22:     /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
   23:     /// 
   24:     /// Copyright notice: This notice may not be removed or altered from any source distribution.
   25:     /// </remarks> 
   26:     public class Site
   27:     {
   28:         private static List<Ia.Statistics.Cl.Model.Site> siteList;
   29:  
   30:         private static readonly object objectLock = new object();
   31:  
   32:         /// <summary/>
   33:         public int Id { get; set; }
   34:  
   35:         /// <summary/>
   36:         public string Name { get; set; }
   37:  
   38:         /// <summary/>
   39:         public string ShortName { get; set; }
   40:  
   41:         /// <summary/>
   42:         public string ArabicName { get; set; }
   43:  
   44:         /// <summary/>
   45:         public string BaseUrl { get; set; }
   46:  
   47:         /// <summary/>
   48:         public string Currency { get; set; }
   49:  
   50:         /// <summary/>
   51:         public string Iso { get; set; }
   52:  
   53:         /// <summary/>
   54:         public Site(int id, string name, string shortName, string arabicName, string baseUrl, string currency, string iso)
   55:         {
   56:             this.Id = id;
   57:             this.Name = name;
   58:             this.ShortName = shortName;
   59:             this.ArabicName = arabicName;
   60:             this.BaseUrl = baseUrl;
   61:             this.Currency = currency;
   62:             this.Iso = iso;
   63:         }
   64:  
   65:         /// <summary/>
   66:         public static Ia.Statistics.Cl.Model.Site EnglishBookshop
   67:         {
   68:             get
   69:             {
   70:                 return (from s in Ia.Statistics.Cl.Model.Site.SiteList
   71:                         where s.ShortName == "eb"
   72:                         select s).Single();
   73:             }
   74:         }
   75:  
   76:         /// <summary/>
   77:         public static Ia.Statistics.Cl.Model.Site NaturelandKuwait
   78:         {
   79:             get
   80:             {
   81:                 return (from s in Ia.Statistics.Cl.Model.Site.SiteList
   82:                         where s.ShortName == "nl-kw"
   83:                         select s).Single();
   84:             }
   85:         }
   86:  
   87:         /// <summary/>
   88:         public static Ia.Statistics.Cl.Model.Site NaturelandSaudiArabia
   89:         {
   90:             get
   91:             {
   92:                 return (from s in Ia.Statistics.Cl.Model.Site.SiteList
   93:                         where s.ShortName == "nl-sa"
   94:                         select s).Single();
   95:             }
   96:         }
   97:  
   98:         /// <summary/>
   99:         public static Ia.Statistics.Cl.Model.Site NaturelandEmirates
  100:         {
  101:             get
  102:             {
  103:                 return (from s in Ia.Statistics.Cl.Model.Site.SiteList
  104:                         where s.ShortName == "nl-ae"
  105:                         select s).Single();
  106:             }
  107:         }
  108:  
  109:         /// <summary/>
  110:         public static Ia.Statistics.Cl.Model.Site NaturelandQatar
  111:         {
  112:             get
  113:             {
  114:                 return (from s in Ia.Statistics.Cl.Model.Site.SiteList
  115:                         where s.ShortName == "nl-qa"
  116:                         select s).Single();
  117:             }
  118:         }
  119:  
  120:         /// <summary/>
  121:         public static Ia.Statistics.Cl.Model.Site NaturelandBahrain
  122:         {
  123:             get
  124:             {
  125:                 return (from s in Ia.Statistics.Cl.Model.Site.SiteList
  126:                         where s.ShortName == "nl-bh"
  127:                         select s).Single();
  128:             }
  129:         }
  130:  
  131:         /// <summary/>
  132:         public static Ia.Statistics.Cl.Model.Site Taw9eel
  133:         {
  134:             get
  135:             {
  136:                 return (from s in Ia.Statistics.Cl.Model.Site.SiteList
  137:                         where s.ShortName == "ta"
  138:                         select s).Single();
  139:             }
  140:         }
  141:  
  142:         /// <summary/>
  143:         public static Ia.Statistics.Cl.Model.Site LuluHypermarketKuwait
  144:         {
  145:             get
  146:             {
  147:                 return (from s in Ia.Statistics.Cl.Model.Site.SiteList
  148:                         where s.ShortName == "lh-kw"
  149:                         select s).Single();
  150:             }
  151:         }
  152:  
  153:         /// <summary/>
  154:         public static Ia.Statistics.Cl.Model.Site FantasyWorldToys
  155:         {
  156:             get
  157:             {
  158:                 return (from s in Ia.Statistics.Cl.Model.Site.SiteList
  159:                         where s.ShortName == "fw"
  160:                         select s).Single();
  161:             }
  162:         }
  163:  
  164:         /// <summary/>
  165:         public static Ia.Statistics.Cl.Model.Site DabdoobKuwait
  166:         {
  167:             get
  168:             {
  169:                 return (from s in Ia.Statistics.Cl.Model.Site.SiteList
  170:                         where s.ShortName == "dd-kw"
  171:                         select s).Single();
  172:             }
  173:         }
  174:  
  175:         /// <summary/>
  176:         public static Ia.Statistics.Cl.Model.Site DabdoobSaudiArabia
  177:         {
  178:             get
  179:             {
  180:                 return (from s in Ia.Statistics.Cl.Model.Site.SiteList
  181:                         where s.ShortName == "dd-sa"
  182:                         select s).Single();
  183:             }
  184:         }
  185:  
  186:         /// <summary/>
  187:         public static Ia.Statistics.Cl.Model.Site DabdoobEmirates
  188:         {
  189:             get
  190:             {
  191:                 return (from s in Ia.Statistics.Cl.Model.Site.SiteList
  192:                         where s.ShortName == "dd-ae"
  193:                         select s).Single();
  194:             }
  195:         }
  196:  
  197:         /// <summary/>
  198:         public static Ia.Statistics.Cl.Model.Site DabdoobQatar
  199:         {
  200:             get
  201:             {
  202:                 return (from s in Ia.Statistics.Cl.Model.Site.SiteList
  203:                         where s.ShortName == "dd-qa"
  204:                         select s).Single();
  205:             }
  206:         }
  207:  
  208:         /// <summary/>
  209:         public static Ia.Statistics.Cl.Model.Site DabdoobBahrain
  210:         {
  211:             get
  212:             {
  213:                 return (from s in Ia.Statistics.Cl.Model.Site.SiteList
  214:                         where s.ShortName == "dd-bh"
  215:                         select s).Single();
  216:             }
  217:         }
  218:  
  219:         /// <summary/>
  220:         public static Ia.Statistics.Cl.Model.Site BoutiqaatKuwait
  221:         {
  222:             get
  223:             {
  224:                 return (from s in Ia.Statistics.Cl.Model.Site.SiteList
  225:                         where s.ShortName == "bo-kw"
  226:                         select s).Single();
  227:             }
  228:         }
  229:  
  230:         /// <summary/>
  231:         public static Ia.Statistics.Cl.Model.Site BoutiqaatOman
  232:         {
  233:             get
  234:             {
  235:                 return (from s in Ia.Statistics.Cl.Model.Site.SiteList
  236:                         where s.ShortName == "bo-om"
  237:                         select s).Single();
  238:             }
  239:         }
  240:  
  241:         /// <summary/>
  242:         public static Ia.Statistics.Cl.Model.Site BoutiqaatSaudiArabia
  243:         {
  244:             get
  245:             {
  246:                 return (from s in Ia.Statistics.Cl.Model.Site.SiteList
  247:                         where s.ShortName == "bo-sa"
  248:                         select s).Single();
  249:             }
  250:         }
  251:  
  252:         /// <summary/>
  253:         public static Ia.Statistics.Cl.Model.Site BoutiqaatEmirates
  254:         {
  255:             get
  256:             {
  257:                 return (from s in Ia.Statistics.Cl.Model.Site.SiteList
  258:                         where s.ShortName == "bo-ae"
  259:                         select s).Single();
  260:             }
  261:         }
  262:  
  263:         /// <summary/>
  264:         public static Ia.Statistics.Cl.Model.Site BoutiqaatQatar
  265:         {
  266:             get
  267:             {
  268:                 return (from s in Ia.Statistics.Cl.Model.Site.SiteList
  269:                         where s.ShortName == "bo-qa"
  270:                         select s).Single();
  271:             }
  272:         }
  273:  
  274:         /// <summary/>
  275:         public static Ia.Statistics.Cl.Model.Site BoutiqaatBahrain
  276:         {
  277:             get
  278:             {
  279:                 return (from s in Ia.Statistics.Cl.Model.Site.SiteList
  280:                         where s.ShortName == "bo-bh"
  281:                         select s).Single();
  282:             }
  283:         }
  284:  
  285:         /// <summary/>
  286:         public static Ia.Statistics.Cl.Model.Site BoutiqaatIraq
  287:         {
  288:             get
  289:             {
  290:                 return (from s in Ia.Statistics.Cl.Model.Site.SiteList
  291:                         where s.ShortName == "bo-iq"
  292:                         select s).Single();
  293:             }
  294:         }
  295:  
  296:         /// <summary/>
  297:         public static Ia.Statistics.Cl.Model.Site HsBookstore
  298:         {
  299:             get
  300:             {
  301:                 return (from s in Ia.Statistics.Cl.Model.Site.SiteList
  302:                         where s.ShortName == "hs"
  303:                         select s).Single();
  304:             }
  305:         }
  306:  
  307:         /// <summary/>
  308:         public static Ia.Statistics.Cl.Model.Site SultanCenter
  309:         {
  310:             get
  311:             {
  312:                 return (from s in Ia.Statistics.Cl.Model.Site.SiteList
  313:                         where s.ShortName == "sc"
  314:                         select s).Single();
  315:             }
  316:         }
  317:  
  318:         /// <summary/>
  319:         public static Ia.Statistics.Cl.Model.Site Undefined
  320:         {
  321:             get
  322:             {
  323:                 return (from s in Ia.Statistics.Cl.Model.Site.SiteList
  324:                         where s.ShortName == "un"
  325:                         select s).Single();
  326:             }
  327:         }
  328:  
  329:         ////////////////////////////////////////////////////////////////////////////
  330:         ////////////////////////////////////////////////////////////////////////////
  331:  
  332:         /// <summary>
  333:         ///
  334:         /// </summary>
  335:         public static Site SiteFromId(int id)
  336:         {
  337:             return (from s in Ia.Statistics.Cl.Model.Site.SiteList
  338:                     where s.Id == id
  339:                     select s).SingleOrDefault();
  340:         }
  341:  
  342:         ////////////////////////////////////////////////////////////////////////////
  343:  
  344:         /// <summary>
  345:         ///
  346:         /// </summary>
  347:         public static string SiteNameFromId(int id)
  348:         {
  349:             return (from s in Ia.Statistics.Cl.Model.Site.SiteList
  350:                     where s.Id == id
  351:                     select s.Name).SingleOrDefault();
  352:         }
  353:  
  354:         ////////////////////////////////////////////////////////////////////////////
  355:  
  356:         /// <summary>
  357:         ///
  358:         /// </summary>
  359:         public static string SiteShortNameFromId(int id)
  360:         {
  361:             return (from s in Ia.Statistics.Cl.Model.Site.SiteList
  362:                     where s.Id == id
  363:                     select s.ShortName).SingleOrDefault();
  364:         }
  365:  
  366:         ////////////////////////////////////////////////////////////////////////////
  367:         ////////////////////////////////////////////////////////////////////////////
  368:  
  369:         /// <summary>
  370:         ///
  371:         /// </summary>
  372:         public static List<Ia.Statistics.Cl.Model.Site> SiteList
  373:         {
  374:             get
  375:             {
  376:                 if (siteList == null || siteList.Count == 0)
  377:                 {
  378:                     lock (objectLock)
  379:                     {
  380:                         siteList = new List<Ia.Statistics.Cl.Model.Site>
  381:                     {
  382:                         new Ia.Statistics.Cl.Model.Site(1, "The English Bookshop", "eb","", "https://theenglishbookshop.com","KWD", "KW"),
  383:  
  384:                         new Ia.Statistics.Cl.Model.Site(2, "Natureland Kuwait", "nl-kw", "أرض الطبيعة الكويت", "https://natureland.net/en-KW","KWD", "KW"),
  385:                         new Ia.Statistics.Cl.Model.Site(3, "Natureland Saudi Arabia", "nl-sa", "أرض الطبيعة السعودية", "https://natureland.net/en-SA","SAR", "SA"),
  386:                         new Ia.Statistics.Cl.Model.Site(4, "Natureland Emirates", "nl-ae", "أرض الطبيعة الإمارات", "https://natureland.net/en-AE","AED", "AE"),
  387:                         new Ia.Statistics.Cl.Model.Site(5, "Natureland Qatar", "nl-qa", "أرض الطبيعة قطر", "https://natureland.net/en-QA","QAR", "QA"),
  388:                         new Ia.Statistics.Cl.Model.Site(6, "Natureland Bahrain", "nl-bh", "أرض الطبيعة البحرين", "https://natureland.net/en-BH","BHD", "BH"),
  389:  
  390:                         new Ia.Statistics.Cl.Model.Site(7, "Taw9eel", "ta", "توصيل", "https://www.taw9eel.com/en","KWD", "KW"), // must keep www
  391:  
  392:                         new Ia.Statistics.Cl.Model.Site(8, "Boutiqaat Kuwait", "bo-kw", "بوتيكات الكويت", "https://boutiqaat.com/en-kw","KWD", "KW"),
  393:                         new Ia.Statistics.Cl.Model.Site(12, "Boutiqaat Oman", "bo-om", "بوتيكات عمان", "https://boutiqaat.com/en-om","OMR", "OM"),
  394:                         new Ia.Statistics.Cl.Model.Site(13, "Boutiqaat Saudi Arabia", "bo-sa", "بوتيكات السعودية", "https://boutiqaat.com/en-sa","SAR", "SA"),
  395:                         new Ia.Statistics.Cl.Model.Site(14, "Boutiqaat Emirates", "bo-ae", "بوتيكات الإمارات", "https://boutiqaat.com/en-ae","AED", "AE"),
  396:                         new Ia.Statistics.Cl.Model.Site(15, "Boutiqaat Qatar", "bo-qa", "بوتيكات قطر", "https://boutiqaat.com/en-qa","QAR", "QA"),
  397:                         new Ia.Statistics.Cl.Model.Site(16, "Boutiqaat Bahrain", "bo-bh", "بوتيكات البحرين", "https://boutiqaat.com/en-bh","BHD", "BH"),
  398:                         new Ia.Statistics.Cl.Model.Site(17, "Boutiqaat Iraq", "bo-iq", "بوتيكات العراق", "https://boutiqaat.com/en-iq","USD", "IQ"), // uses USD in Iraq
  399:  
  400:                         new Ia.Statistics.Cl.Model.Site(9, "Lulu Hypermarket Kuwait", "lh-kw", "لولو هايبر ماركت الكويت", "https://www.luluhypermarket.com/en-kw","KWD", "KW"),
  401:  
  402:                         new Ia.Statistics.Cl.Model.Site(10, "Fantasy World", "fw", "فانتسي وورلد", "https://fantasyworldtoys.com","KWD", "KW"),
  403:  
  404:                         new Ia.Statistics.Cl.Model.Site(11, "Dabdoob Kuwait", "dd-kw", "دبدوب الكويت", "https://dabdoob.com/en-KW","KWD", "KW"),
  405:                         new Ia.Statistics.Cl.Model.Site(19, "Dabdoob Saudi Arabia", "dd-sa", "دبدوب السعودية", "https://dabdoob.com/en-SA","SAR", "SA"),
  406:                         new Ia.Statistics.Cl.Model.Site(20, "Dabdoob Emirates", "dd-ae", "دبدوب الإمارات", "https://dabdoob.com/en-AE","AED", "AE"),
  407:                         new Ia.Statistics.Cl.Model.Site(21, "Dabdoob Qatar", "dd-qa", "دبدوب قطر", "https://dabdoob.com/en-QA","QAR", "QA"),
  408:                         new Ia.Statistics.Cl.Model.Site(22, "Dabdoob Bahrain", "dd-bh", "دبدوب البحرين", "https://dabdoob.com/en-BH","BHD", "BH"),
  409:  
  410:                         new Ia.Statistics.Cl.Model.Site(23, "Health Sciences Bookstore", "hs", "مكتبة هيلث سيينس", "https://www.hsbookstore.com/kwt_en","KWD", "KW"),
  411:                         new Ia.Statistics.Cl.Model.Site(24, "Sultan Center", "sc", "مركز سلطان", "https://www.sultan-center.com","KWD", "KW"),
  412:                     };
  413:                     }
  414:                 }
  415:  
  416:                 return siteList;
  417:             }
  418:         }
  419:  
  420:         ////////////////////////////////////////////////////////////////////////////
  421:         ////////////////////////////////////////////////////////////////////////////    
  422:     }
  423: }