Professional Applications Programmers/Consultants برمجة واستشارات تطبيقات الإنترنت
Skip Navigation LinksHome » Code Library » Default

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

Default data support functions

   1:  using System;
   2:  using System.Web;
   3:  using System.Xml;
   4:  using System.Xml.Linq;
   5:  using System.IO;
   6:  using System.Configuration;
   7:  using System.Text;
   8:  using System.Text.RegularExpressions;
   9:  using System.Data;
  10:  using System.Data.SqlClient;
  11:  using System.Collections;
  12:  using System.Reflection;
  13:   
  14:  namespace Ia.Learning.Cl.Model
  15:  {
  16:      ////////////////////////////////////////////////////////////////////////////
  17:   
  18:      /// <summary publish="true">
  19:      /// Default data support functions
  20:      /// </summary>
  21:      /// <value>
  22:      /// https://msdn.microsoft.com/en-us/library/z1hkazw7(v=vs.100).aspx
  23:      /// </value>
  24:      /// <remarks> 
  25:      /// Copyright © 2008-2015 Jasem Y. Al-Shamlan (info@ia.com.kw), Internet Applications - Kuwait. All Rights Reserved.
  26:      ///
  27:      /// 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
  28:      /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  29:      ///
  30:      /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  31:      /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  32:      /// 
  33:      /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
  34:      /// 
  35:      /// Copyright notice: This notice may not be removed or altered from any source distribution.
  36:      /// </remarks> 
  37:      public partial class Default
  38:      {
  39:          ////////////////////////////////////////////////////////////////////////////
  40:   
  41:          /// <summary>
  42:          ///
  43:          /// </summary>
  44:          public Default() { }
  45:   
  46:          ////////////////////////////////////////////////////////////////////////////
  47:   
  48:          /// <summary>
  49:          ///
  50:          /// </summary>
  51:          public static string CompanyNameFromId(int id) 
  52:          {
  53:              string companyName;
  54:   
  55:              switch (id)
  56:              {
  57:                  case 1: companyName = "Alcatel-Lucent"; break;
  58:                  case 2: companyName = "Huawei"; break;
  59:                  default: companyName = ""; break;
  60:              }
  61:   
  62:              return companyName;
  63:          }
  64:   
  65:          ////////////////////////////////////////////////////////////////////////////
  66:   
  67:          /// <summary>
  68:          ///
  69:          /// </summary>
  70:          public static int CompanyIdFromName(string name)
  71:          {
  72:              int companyId;
  73:   
  74:              switch (name)
  75:              {
  76:                  case "Alcatel-Lucent": companyId = 1; break;
  77:                  case "Huawei": companyId = 2; break;
  78:                  default: companyId = 0; break;
  79:              }
  80:   
  81:              return companyId;
  82:          }
  83:   
  84:          ////////////////////////////////////////////////////////////////////////////
  85:   
  86:          /// <summary>
  87:          ///
  88:          /// </summary>
  89:          public static SortedList CompanyNameSortedList
  90:          {
  91:              get
  92:              {
  93:                  SortedList companyNameSortedList;
  94:   
  95:                  companyNameSortedList = new SortedList(3);
  96:   
  97:                  companyNameSortedList[1] = "Alcatel-Lucent";
  98:                  companyNameSortedList[2] = "Huawei";
  99:   
 100:                  return companyNameSortedList;
 101:              }
 102:          }
 103:   
 104:          ////////////////////////////////////////////////////////////////////////////    
 105:          ////////////////////////////////////////////////////////////////////////////    
 106:      }
 107:   
 108:      ////////////////////////////////////////////////////////////////////////////
 109:      ////////////////////////////////////////////////////////////////////////////   
 110:  }