شركة التطبيقات المتكاملة لتصميم النظم البرمجية الخاصة

Integrated Applications Programming Company

Skip Navigation LinksHome » Code Library » Default

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

Default support class for Next Generation Network (NGN) ui model.

   1:  using System;
   2:  using System.Web;
   3:  using System.Configuration;
   4:  using System.Text;
   5:  using System.Text.RegularExpressions;
   6:  using System.Data;
   7:  using System.Web.UI;
   8:  using System.Web.UI.WebControls;
   9:  using System.Collections.Generic;
  10:  using System.Linq;
  11:  using System.Web.Security;
  12:   
  13:   
  14:  namespace Ia.Ngn.Cl.Model.Ui
  15:  {
  16:      ////////////////////////////////////////////////////////////////////////////
  17:   
  18:      /// <summary publish="true">
  19:      /// Default support class for Next Generation Network (NGN) ui model.
  20:      /// </summary>
  21:      /// 
  22:      /// <remarks> 
  23:      /// Copyright © 2006-2017 Jasem Y. Al-Shamlan (info@ia.com.kw), Internet Applications - Kuwait. All Rights Reserved.
  24:      ///
  25:      /// 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
  26:      /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  27:      ///
  28:      /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  29:      /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  30:      /// 
  31:      /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
  32:      /// 
  33:      /// Copyright notice: This notice may not be removed or altered from any source distribution.
  34:      /// </remarks> 
  35:      public partial class Default
  36:      {
  37:          private static List<string> lightBackgroundColorList, darkBackgroundColorList;
  38:          private static List<ColorAndSuitableBackground> colorAndSuitableBackgroundList;
  39:   
  40:          /// <summary/>
  41:          public enum GridViewButtonColumnType
  42:          {
  43:              /// <summary/>
  44:              NoButtons,
  45:              /// <summary/>
  46:              HistoryButton,
  47:              /// <summary/>
  48:              DeleteAndDeleteOffButton,
  49:              /// <summary/>
  50:              DeleteAndDeleteOffAndDeleteChildOffAndHistoryButtons,
  51:              /// <summary/>
  52:              DeleteAndEditAndCancelAndUpdateButtons
  53:          }
  54:   
  55:          ////////////////////////////////////////////////////////////////////////////
  56:   
  57:          /// <summary>
  58:          ///
  59:          /// </summary>
  60:          public static string MailTop()
  61:          {
  62:              // <title>" + ConfigurationManager.AppSettings["siteName"].ToString() + ": " + ConfigurationManager.AppSettings["companyName"].ToString() + @"</title>
  63:              // <p><b>" + ConfigurationManager.AppSettings["siteName"].ToString() + "</b>: <b>" + ConfigurationManager.AppSettings["companyName"].ToString() + @"</b></p>
  64:   
  65:              return @"
  66:  <!DOCTYPE html>
  67:  <html xmlns=""http://www.w3.org/1999/xhtml"" >
  68:  <head>
  69:  <title>" + ConfigurationManager.AppSettings["siteName"].ToString() + @": " + ConfigurationManager.AppSettings["companyName"].ToString() + @"</title>
  70:  <style>
  71:  html { direction:ltr; }
  72:  body { background:#fff;margin:5px;padding:0px;color:DarkBlue; }
  73:  body,td,th,a,input.button_ia,input,textarea,option,select,pre { font:9pt normal #000066 ""Tahoma"";font-family:Tahoma;text-decoration:none; }
  74:  a:link { color:#0000ff;text-decoration:none; }
  75:  a:visited { color:#0000ff;text-decoration:none; }
  76:  a:hover { color:#ff8888;text-decoration:none; }
  77:  hr { color:rgb(204,204,204); }
  78:  p { line-height:18px;margin-top:9px;margin-bottom:9px; }
  79:  table.form { }
  80:  table.form td { }
  81:  </style>
  82:  </head>
  83:  <body>
  84:  <p>
  85:  <b>" + ConfigurationManager.AppSettings["siteName"].ToString() + @"</b>: 
  86:  <b>" + ConfigurationManager.AppSettings["companyName"].ToString() + @"</b>
  87:  </p>
  88:  ";
  89:          }
  90:   
  91:          ////////////////////////////////////////////////////////////////////////////
  92:   
  93:          /// <summary>
  94:          ///
  95:          /// </summary>
  96:          public static string PlainMailTop()
  97:          {
  98:              return ConfigurationManager.AppSettings["siteName"].ToString() + "\t\r\n" + ConfigurationManager.AppSettings["companyName"].ToString() + @"
  99:   
 100:  ";
 101:              // above: "\t\r\n" is very important to produce good email format
 102:          }
 103:   
 104:          ////////////////////////////////////////////////////////////////////////////
 105:   
 106:          /// <summary>
 107:          ///
 108:          /// </summary>
 109:          public static string MailBottom()
 110:          {
 111:              return @"
 112:  </body>
 113:  </html>
 114:  ";
 115:          }
 116:   
 117:          ////////////////////////////////////////////////////////////////////////////
 118:   
 119:          /// <summary>
 120:          ///
 121:          /// </summary>
 122:          public static string PlainMailBottom()
 123:          {
 124:              return @"";
 125:          }
 126:   
 127:          ////////////////////////////////////////////////////////////////////////////
 128:          ////////////////////////////////////////////////////////////////////////////
 129:   
 130:          /// <summary>
 131:          ///
 132:          /// </summary>
 133:          public struct ColorAndSuitableBackground
 134:          {
 135:              public string Name, Background;
 136:   
 137:              public ColorAndSuitableBackground(string name, string background)
 138:              {
 139:                  Name = name;
 140:                  Background = background;
 141:              }
 142:          }
 143:   
 144:          ////////////////////////////////////////////////////////////////////////////
 145:   
 146:          /// <summary>
 147:          ///
 148:          /// </summary>
 149:          public static List<string> LightBackgroundColorList
 150:          {
 151:              get
 152:              {
 153:                  //if (lightBackgroundColorList == null || lightBackgroundColorList.Count == 0)
 154:                  //{
 155:                  lightBackgroundColorList = new List<string>(200);
 156:   
 157:                  foreach (ColorAndSuitableBackground c in ColorAndSuitableBackgroundList)
 158:                  {
 159:                      if (c.Background == "light") lightBackgroundColorList.Add(c.Name);
 160:                  }
 161:                  //}
 162:   
 163:                  return lightBackgroundColorList;
 164:              }
 165:          }
 166:   
 167:          ////////////////////////////////////////////////////////////////////////////
 168:   
 169:          /// <summary>
 170:          ///
 171:          /// </summary>
 172:          public static List<string> DarkBackgroundColorList
 173:          {
 174:              get
 175:              {
 176:                  //if (darkBackgroundColorList == null || darkBackgroundColorList.Count == 0)
 177:                  //{
 178:                  darkBackgroundColorList = new List<string>(200);
 179:   
 180:                  foreach (ColorAndSuitableBackground c in ColorAndSuitableBackgroundList)
 181:                  {
 182:                      if (c.Background == "dark") darkBackgroundColorList.Add(c.Name);
 183:                  }
 184:                  //}
 185:   
 186:                  return darkBackgroundColorList;
 187:              }
 188:          }
 189:   
 190:          ////////////////////////////////////////////////////////////////////////////
 191:   
 192:          /// <summary>
 193:          ///
 194:          /// </summary>
 195:          public static List<ColorAndSuitableBackground> ColorAndSuitableBackgroundList
 196:          {
 197:              get
 198:              {
 199:                  //if (colorAndSuitableBackgroundList == null || colorAndSuitableBackgroundList.Count == 0)
 200:                  //{
 201:                  colorAndSuitableBackgroundList = new List<ColorAndSuitableBackground>(200)
 202:                          {
 203:                              new ColorAndSuitableBackground("AliceBlue", "dark"),
 204:                              new ColorAndSuitableBackground("AliceBlue", "dark"),
 205:                              new ColorAndSuitableBackground("AntiqueWhite", "dark"),
 206:                              new ColorAndSuitableBackground("Aqua", "dark"),
 207:                              new ColorAndSuitableBackground("Aquamarine", "dark"),
 208:                              new ColorAndSuitableBackground("Azure", "dark"),
 209:                              new ColorAndSuitableBackground("Beige", "dark"),
 210:                              new ColorAndSuitableBackground("Bisque", "dark"),
 211:                              new ColorAndSuitableBackground("Black", "light"),
 212:                              new ColorAndSuitableBackground("BlanchedAlmond", "dark"),
 213:                              new ColorAndSuitableBackground("Blue", "light"),
 214:                              new ColorAndSuitableBackground("BlueViolet", "light"),
 215:                              new ColorAndSuitableBackground("Brown", "light"),
 216:                              new ColorAndSuitableBackground("BurlyWood", "dark"),
 217:                              new ColorAndSuitableBackground("CadetBlue", "light"),
 218:                              new ColorAndSuitableBackground("Chartreuse", "light"),
 219:                              new ColorAndSuitableBackground("Chocolate", "light"),
 220:                              new ColorAndSuitableBackground("Coral", "dark"),
 221:                              new ColorAndSuitableBackground("CornFlowerBlue", "dark"),
 222:                              new ColorAndSuitableBackground("Cornsilk", "dark"),
 223:                              new ColorAndSuitableBackground("Crimson", "light"),
 224:                              new ColorAndSuitableBackground("Cyan", "dark"),
 225:                              new ColorAndSuitableBackground("DarkBlue", "light"),
 226:                              new ColorAndSuitableBackground("DarkCyan", "light"),
 227:                              new ColorAndSuitableBackground("DarkGoldenrod", "light"),
 228:                              new ColorAndSuitableBackground("DarkGray", "dark"),
 229:                              new ColorAndSuitableBackground("DarkGreen", "light"),
 230:                              new ColorAndSuitableBackground("DarkKhaki", "dark"),
 231:                              new ColorAndSuitableBackground("DarkMagenta", "light"),
 232:                              new ColorAndSuitableBackground("DarkOliveGreen", "light"),
 233:                              new ColorAndSuitableBackground("DarkOrange", "dark"),
 234:                              new ColorAndSuitableBackground("DarkOrchid", "light"),
 235:                              new ColorAndSuitableBackground("DarkRed", "light"),
 236:                              new ColorAndSuitableBackground("DarkSalmon", "dark"),
 237:                              new ColorAndSuitableBackground("DarkSeaGreen", "dark"),
 238:                              new ColorAndSuitableBackground("DarkSlateBlue", "light"),
 239:                              new ColorAndSuitableBackground("DarkSlateGray", "light"),
 240:                              new ColorAndSuitableBackground("DarkTurquoise", "light"),
 241:                              new ColorAndSuitableBackground("DarkViolet", "light"),
 242:                              new ColorAndSuitableBackground("DeepPink", "light"),
 243:                              new ColorAndSuitableBackground("DeepSkyBlue", "light"),
 244:                              new ColorAndSuitableBackground("DimGray", "light"),
 245:                              new ColorAndSuitableBackground("DodgerBlue", "light"),
 246:                              new ColorAndSuitableBackground("Firebrick", "light"),
 247:                              new ColorAndSuitableBackground("FloralWhite", "dark"),
 248:                              new ColorAndSuitableBackground("ForestGreen", "light"),
 249:                              new ColorAndSuitableBackground("Fuchsia", "dark"),
 250:                              new ColorAndSuitableBackground("Gainsboro", "dark"),
 251:                              new ColorAndSuitableBackground("GhostWhite", "dark"),
 252:                              new ColorAndSuitableBackground("Gold", "dark"),
 253:                              new ColorAndSuitableBackground("Goldenrod", "dark"),
 254:                              new ColorAndSuitableBackground("Gray", "light"),
 255:                              new ColorAndSuitableBackground("Green", "light"),
 256:                              new ColorAndSuitableBackground("GreenYellow", "dark"),
 257:                              new ColorAndSuitableBackground("Honeydew", "dark"),
 258:                              new ColorAndSuitableBackground("HotPink", "dark"),
 259:                              new ColorAndSuitableBackground("IndianRed", "light"),
 260:                              new ColorAndSuitableBackground("Indigo", "light"),
 261:                              new ColorAndSuitableBackground("Ivory", "dark"),
 262:                              new ColorAndSuitableBackground("Khaki", "dark"),
 263:                              new ColorAndSuitableBackground("Lavender", "dark"),
 264:                              new ColorAndSuitableBackground("LavenderBlush", "dark"),
 265:                              new ColorAndSuitableBackground("LawnGreen", "light"),
 266:                              new ColorAndSuitableBackground("LemonChiffon", "dark"),
 267:                              new ColorAndSuitableBackground("LightBlue", "dark"),
 268:                              new ColorAndSuitableBackground("LightCoral", "dark"),
 269:                              new ColorAndSuitableBackground("LightCyan", "dark"),
 270:                              new ColorAndSuitableBackground("LightGoldenRodYellow", "dark"),
 271:                              new ColorAndSuitableBackground("LightGray", "dark"),
 272:                              new ColorAndSuitableBackground("LightGreen", "dark"),
 273:                              new ColorAndSuitableBackground("LightPink", "dark"),
 274:                              new ColorAndSuitableBackground("LightSalmon", "dark"),
 275:                              new ColorAndSuitableBackground("LightSeaGreen", "light"),
 276:                              new ColorAndSuitableBackground("LightSkyBlue", "dark"),
 277:                              new ColorAndSuitableBackground("LightSlateGray", "light"),
 278:                              new ColorAndSuitableBackground("LightSteelBlue", "dark"),
 279:                              new ColorAndSuitableBackground("LightYellow", "dark"),
 280:                              new ColorAndSuitableBackground("Lime", "light"),
 281:                              new ColorAndSuitableBackground("LimeGreen", "light"),
 282:                              new ColorAndSuitableBackground("Linen", "dark"),
 283:                              new ColorAndSuitableBackground("Magenta", "dark"),
 284:                              new ColorAndSuitableBackground("Maroon", "light"),
 285:                              new ColorAndSuitableBackground("MediumAquamarine", "dark"),
 286:                              new ColorAndSuitableBackground("MediumBlue", "light"),
 287:                              new ColorAndSuitableBackground("MediumOrchid", "dark"),
 288:                              new ColorAndSuitableBackground("MediumPurple", "dark"),
 289:                              new ColorAndSuitableBackground("MediumSeaGreen", "light"),
 290:                              new ColorAndSuitableBackground("MediumSlateBlue", "light"),
 291:                              new ColorAndSuitableBackground("MediumSpringGreen", "light"),
 292:                              new ColorAndSuitableBackground("MediumTurquoise", "dark"),
 293:                              new ColorAndSuitableBackground("MediumVioletRed", "light"),
 294:                              new ColorAndSuitableBackground("MidnightBlue", "light"),
 295:                              new ColorAndSuitableBackground("MintCream", "dark"),
 296:                              new ColorAndSuitableBackground("MistyRose", "dark"),
 297:                              new ColorAndSuitableBackground("Moccasin", "dark"),
 298:                              new ColorAndSuitableBackground("NavajoWhite", "dark"),
 299:                              new ColorAndSuitableBackground("Navy", "light"),
 300:                              new ColorAndSuitableBackground("OldLace", "dark"),
 301:                              new ColorAndSuitableBackground("Olive", "light"),
 302:                              new ColorAndSuitableBackground("OliveDrab", "light"),
 303:                              new ColorAndSuitableBackground("Orange", "dark"),
 304:                              new ColorAndSuitableBackground("OrangeRed", "light"),
 305:                              new ColorAndSuitableBackground("Orchid", "dark"),
 306:                              new ColorAndSuitableBackground("PaleGoldenrod", "dark"),
 307:                              new ColorAndSuitableBackground("PaleGreen", "dark"),
 308:                              new ColorAndSuitableBackground("PaleTurquoise", "dark"),
 309:                              new ColorAndSuitableBackground("PaleVioletRed", "dark"),
 310:                              new ColorAndSuitableBackground("PapayaWhip", "dark"),
 311:                              new ColorAndSuitableBackground("PeachPuff", "dark"),
 312:                              new ColorAndSuitableBackground("Peru", "light"),
 313:                              new ColorAndSuitableBackground("Pink", "dark"),
 314:                              new ColorAndSuitableBackground("Plum", "dark"),
 315:                              new ColorAndSuitableBackground("PowderBlue", "dark"),
 316:                              new ColorAndSuitableBackground("Purple", "light"),
 317:                              new ColorAndSuitableBackground("Red", "light"),
 318:                              new ColorAndSuitableBackground("RosyBrown", "dark"),
 319:                              new ColorAndSuitableBackground("RoyalBlue", "light"),
 320:                              new ColorAndSuitableBackground("SaddleBrown", "light"),
 321:                              new ColorAndSuitableBackground("Salmon", "dark"),
 322:                              new ColorAndSuitableBackground("SandyBrown", "dark"),
 323:                              new ColorAndSuitableBackground("SeaGreen", "light"),
 324:                              new ColorAndSuitableBackground("SeaShell", "dark"),
 325:                              new ColorAndSuitableBackground("Sienna", "light"),
 326:                              new ColorAndSuitableBackground("Silver", "dark"),
 327:                              new ColorAndSuitableBackground("SkyBlue", "dark"),
 328:                              new ColorAndSuitableBackground("SlateBlue", "light"),
 329:                              new ColorAndSuitableBackground("SlateGray", "light"),
 330:                              new ColorAndSuitableBackground("Snow", "dark"),
 331:                              new ColorAndSuitableBackground("SpringGreen", "light"),
 332:                              new ColorAndSuitableBackground("SteelBlue", "light"),
 333:                              new ColorAndSuitableBackground("Tan", "dark"),
 334:                              new ColorAndSuitableBackground("Teal", "light"),
 335:                              new ColorAndSuitableBackground("Thistle", "dark"),
 336:                              new ColorAndSuitableBackground("Tomato", "dark"),
 337:                              //colorAndSuitableBackgroundList.Add(new ColorAndSuitableBackground("Transparent", "light"));
 338:                              new ColorAndSuitableBackground("Turquoise", "dark"),
 339:                              new ColorAndSuitableBackground("Violet", "dark"),
 340:                              new ColorAndSuitableBackground("Wheat", "dark"),
 341:                              new ColorAndSuitableBackground("White", "dark"),
 342:                              new ColorAndSuitableBackground("WhiteSmoke", "dark"),
 343:                              new ColorAndSuitableBackground("Yellow", "dark"),
 344:                              new ColorAndSuitableBackground("YellowGreen", "light")
 345:                          };
 346:                  //}
 347:   
 348:                  return colorAndSuitableBackgroundList.ToList();
 349:              }
 350:          }
 351:   
 352:          ////////////////////////////////////////////////////////////////////////////   
 353:   
 354:          /// <summary>
 355:          ///
 356:          /// </summary>
 357:          public static void RemoveAllComments(ref StringBuilder sb)
 358:          {
 359:              string s;
 360:   
 361:              s = Regex.Replace(sb.ToString(), @"#.+", "");
 362:   
 363:              s = Regex.Replace(s, @"[\r\n]{2,}", "\r\n");
 364:   
 365:              sb = new StringBuilder(s);
 366:          }
 367:   
 368:          ////////////////////////////////////////////////////////////////////////////   
 369:   
 370:          /// <summary>
 371:          ///
 372:          /// </summary>
 373:          public static void ConvertArrayListContentToString(List<string> list, ref StringBuilder sb, ref string result)
 374:          {
 375:              if (list != null && list.Count > 0)
 376:              {
 377:                  sb = new StringBuilder(list.Count * 1000);
 378:   
 379:                  foreach (string u in list) sb.Append(u + "\n");
 380:   
 381:                  result = string.Empty;
 382:              }
 383:              else
 384:              {
 385:                  sb = new StringBuilder(1);
 386:   
 387:                  result = "Success: No records were found. ";
 388:              }
 389:          }
 390:   
 391:          ////////////////////////////////////////////////////////////////////////////   
 392:   
 393:          /// <summary>
 394:          ///
 395:          /// </summary>
 396:          public static void ConvertListContentToString(List<string> list, ref StringBuilder sb, ref string result)
 397:          {
 398:              if (list != null && list.Count > 0)
 399:              {
 400:                  sb = new StringBuilder(list.Count * 1000);
 401:   
 402:                  foreach (string u in list) sb.Append(u + "\n");
 403:   
 404:                  result = string.Empty;
 405:              }
 406:              else
 407:              {
 408:                  sb = new StringBuilder(1);
 409:   
 410:                  result = "Success: No records were found. ";
 411:              }
 412:          }
 413:   
 414:          ////////////////////////////////////////////////////////////////////////////
 415:   
 416:          /// <summary>
 417:          ///
 418:          /// </summary>
 419:          public static void GridView_RowDataBound(System.Web.UI.Page page, object sender, GridViewRowEventArgs e)
 420:          {
 421:              GridViewButtonColumnType buttonColumnType;
 422:              Ia.Ngn.Cl.Model.Staff staffMembershipUser;
 423:   
 424:              buttonColumnType = GridViewButtonColumnType.NoButtons;
 425:              staffMembershipUser = null;
 426:   
 427:              GridView_RowDataBound(page, sender, e, buttonColumnType, staffMembershipUser);
 428:          }
 429:   
 430:          ////////////////////////////////////////////////////////////////////////////
 431:   
 432:          /// <summary>
 433:          ///
 434:          /// </summary>
 435:          public static void GridView_RowDataBound(System.Web.UI.Page page, object sender, GridViewRowEventArgs e, Ia.Ngn.Cl.Model.Staff staffMembershipUser)
 436:          {
 437:              GridViewButtonColumnType buttonColumnType;
 438:   
 439:              // below: default is no buttons
 440:              buttonColumnType = GridViewButtonColumnType.NoButtons;
 441:   
 442:              GridView_RowDataBound(page, sender, e, buttonColumnType, staffMembershipUser);
 443:          }
 444:   
 445:          ////////////////////////////////////////////////////////////////////////////
 446:   
 447:          /// <summary>
 448:          ///
 449:          /// </summary>
 450:          public static void GridView_RowDataBound(System.Web.UI.Page page, object sender, GridViewRowEventArgs e, GridViewButtonColumnType buttonColumnType)
 451:          {
 452:              Ia.Ngn.Cl.Model.Staff staffMembershipUser;
 453:   
 454:              staffMembershipUser = null;
 455:   
 456:              GridView_RowDataBound(page, sender, e, buttonColumnType, staffMembershipUser);
 457:          }
 458:   
 459:          ////////////////////////////////////////////////////////////////////////////
 460:   
 461:          /// <summary>
 462:          ///
 463:          /// </summary>
 464:          public static void GridView_RowDataBound(System.Web.UI.Page page, object sender, GridViewRowEventArgs e, GridViewButtonColumnType buttonColumnType, Ia.Ngn.Cl.Model.Staff staffMembershipUser)
 465:          {
 466:              bool senderKnown;
 467:              int areaId;
 468:              string s, senderId;
 469:              Guid userId, _userId;
 470:              List<Ia.Cl.Model.Identity.User> userList;
 471:   
 472:              // below: initialize according to ID of parent
 473:              Ia.Ngn.Cl.Model.Report report;
 474:              Ia.Ngn.Cl.Model.ReportHistory reportHistory;
 475:              Ia.Ngn.Cl.Model.ServiceRequest serviceRequest;
 476:              Ia.Ngn.Cl.Model.ServiceRequestHistory serviceRequestHistory;
 477:              Ia.Ngn.Cl.Model.ServiceRequestOnt serviceRequestOnt;
 478:              Ia.Ngn.Cl.Model.ServiceRequestOntDetail serviceRequestOntDetail;
 479:              Ia.Ngn.Cl.Model.Ui.Huawei.HuSbr huSbr;
 480:              Ia.Ngn.Cl.Model.Huawei.Owsbr owsbr;
 481:              Ia.Ngn.Cl.Model.Huawei.Seruattr seruattr;
 482:              Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt;
 483:              Ia.Ngn.Cl.Model.Ont ont;
 484:              Ia.Ngn.Cl.Model.OntOntPots ontOntPots;
 485:              Ia.Ngn.Cl.Model.Ui.ServiceRequestService serviceRequestService;
 486:              Ia.Ngn.Cl.Model.Access access;
 487:              Ia.Ngn.Cl.Model.Ui.Service2 service2;
 488:              Ia.Ngn.Cl.Model.Ui.Nokia.AgcfGatewayRecord agcfGatewayRecord;
 489:              Ia.Ngn.Cl.Model.Ui.Nokia.AgcfEndpoint agcfEndpoint;
 490:              Ia.Ngn.Cl.Model.Ui.Nokia.SubParty subParty;
 491:              Ia.Ngn.Cl.Model.Ui.Nokia.Subscriber subscriber;
 492:              Ia.Ngn.Cl.Model.OntServiceVoip ontServiceVoip;
 493:              Ia.Ngn.Cl.Model.Huawei.EmsDev emsDev;
 494:              Ia.Ngn.Cl.Model.Huawei.EmsBoard emsBoard;
 495:              Ia.Ngn.Cl.Model.Huawei.EmsPort emsPort;
 496:              Ia.Ngn.Cl.Model.Ui.Huawei.EmsOnt emsOnt;
 497:              Ia.Ngn.Cl.Model.Huawei.EmsOntSipInfo emsOntSipInfo;
 498:              Ia.Ngn.Cl.Model.Huawei.EmsVoipPstnUser emsVoipPstnUser;
 499:              Ia.Ngn.Cl.Model.Staff staff;
 500:              Ia.Ngn.Cl.Model.Contact contact;
 501:              Ia.Ngn.Cl.Model.ServiceExemption serviceExemption;
 502:              Ia.Ngn.Cl.Model.Ui.ReportAccessServiceRequest reportAccessServiceRequest;
 503:              Ia.Ngn.Cl.Model.Business.Service.KuwaitNgnArea kuwaitNgnArea;
 504:              Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor vendor;
 505:              Ia.Ngn.Cl.Model.Ui.Maintenance.AccessFamilyTypeAreaBlock accessFamilyTypeInAreaBlock;
 506:              Ia.Ngn.Cl.Model.Ui.Event newOntEvent;
 507:              Ia.Ngn.Cl.Model.Business.ServiceAccessName serviceAccessName;
 508:              MembershipUser membershipUser;
 509:   
 510:              areaId = 0;
 511:              userId = Guid.Empty;
 512:              senderId = e.Row.Parent.Parent.ID;
 513:   
 514:              if (e.Row.RowType == DataControlRowType.Header || e.Row.RowType == DataControlRowType.Footer || e.Row.RowType == DataControlRowType.DataRow)
 515:              {
 516:                  report = null;
 517:                  reportHistory = null;
 518:                  serviceRequest = null;
 519:                  serviceRequestHistory = null;
 520:                  serviceRequestOnt = null;
 521:                  serviceRequestOntDetail = null;
 522:                  huSbr = null;
 523:                  owsbr = null;
 524:                  seruattr = null;
 525:                  agcfGatewayRecord = null;
 526:                  agcfEndpoint = null;
 527:                  subParty = null;
 528:                  subscriber = null;
 529:                  nddOnt = null;
 530:                  ont = null;
 531:                  serviceRequestService = null;
 532:                  access = null;
 533:                  ontOntPots = null;
 534:                  ontServiceVoip = null;
 535:                  emsDev = null;
 536:                  emsBoard = null;
 537:                  emsPort = null;
 538:                  emsOnt = null;
 539:                  emsOntSipInfo = null;
 540:                  service2 = null;
 541:                  staff = null;
 542:                  contact = null;
 543:                  serviceExemption = null;
 544:                  membershipUser = null;
 545:                  reportAccessServiceRequest = null;
 546:                  kuwaitNgnArea = null;
 547:                  vendor = null;
 548:                  accessFamilyTypeInAreaBlock = null;
 549:                  newOntEvent = null;
 550:                  serviceAccessName = null;
 551:   
 552:                  senderKnown = true;
 553:   
 554:                  switch (senderId)
 555:                  {
 556:                      case "reportGridView":
 557:                          {
 558:                              report = (e.Row.DataItem as Ia.Ngn.Cl.Model.Report);
 559:                              buttonColumnType = GridViewButtonColumnType.DeleteAndDeleteOffAndDeleteChildOffAndHistoryButtons;
 560:                              break;
 561:                          }
 562:                      case "fieldTnmdSupplierReportGridView":
 563:                          {
 564:                              reportAccessServiceRequest = (e.Row.DataItem as Ia.Ngn.Cl.Model.Ui.ReportAccessServiceRequest);
 565:                              break;
 566:                          }
 567:                      case "insertedRecordGridView":
 568:                          {
 569:                              report = (e.Row.DataItem as Ia.Ngn.Cl.Model.Report);
 570:                              break;
 571:                          }
 572:                      case "reportListHistoryColumnOnlyGridView":
 573:                          {
 574:                              report = (e.Row.DataItem as Ia.Ngn.Cl.Model.Report);
 575:                              buttonColumnType = GridViewButtonColumnType.HistoryButton;
 576:                              break;
 577:                          }
 578:                      case "reportHistoryGridView":
 579:                          {
 580:                              reportHistory = (e.Row.DataItem as Ia.Ngn.Cl.Model.ReportHistory);
 581:                              buttonColumnType = GridViewButtonColumnType.DeleteAndDeleteOffButton;
 582:                              break;
 583:                          }
 584:                      case "serviceRequestGridView":
 585:                          {
 586:                              serviceRequest = (e.Row.DataItem as Ia.Ngn.Cl.Model.ServiceRequest);
 587:                              break;
 588:                          }
 589:                      case "serviceRequestHistoryGridView":
 590:                          {
 591:                              serviceRequestHistory = (e.Row.DataItem as Ia.Ngn.Cl.Model.ServiceRequestHistory);
 592:                              break;
 593:                          }
 594:                      case "serviceRequestOntGridView":
 595:                          {
 596:                              serviceRequestOnt = (e.Row.DataItem as Ia.Ngn.Cl.Model.ServiceRequestOnt);
 597:                              break;
 598:                          }
 599:                      case "serviceRequestOntDetailGridView":
 600:                          {
 601:                              serviceRequestOntDetail = (e.Row.DataItem as Ia.Ngn.Cl.Model.ServiceRequestOntDetail);
 602:                              break;
 603:                          }
 604:                      case "huSbrGridView":
 605:                          {
 606:                              huSbr = (e.Row.DataItem as Ia.Ngn.Cl.Model.Ui.Huawei.HuSbr);
 607:                              break;
 608:                          }
 609:                      case "owsbrGridView":
 610:                          {
 611:                              owsbr = (e.Row.DataItem as Ia.Ngn.Cl.Model.Huawei.Owsbr);
 612:                              break;
 613:                          }
 614:                      case "seruattrGridView":
 615:                          {
 616:                              seruattr = (e.Row.DataItem as Ia.Ngn.Cl.Model.Huawei.Seruattr);
 617:                              break;
 618:                          }
 619:                      case "agcfGatewayRecordGridView":
 620:                          {
 621:                              agcfGatewayRecord = (e.Row.DataItem as Ia.Ngn.Cl.Model.Ui.Nokia.AgcfGatewayRecord);
 622:                              break;
 623:                          }
 624:                      case "agcfEndpointGridView":
 625:                          {
 626:                              agcfEndpoint = (e.Row.DataItem as Ia.Ngn.Cl.Model.Ui.Nokia.AgcfEndpoint);
 627:                              break;
 628:                          }
 629:                      case "subPartyGridView":
 630:                          {
 631:                              subParty = (e.Row.DataItem as Ia.Ngn.Cl.Model.Ui.Nokia.SubParty);
 632:                              break;
 633:                          }
 634:                      case "subscriberGridView":
 635:                          {
 636:                              subscriber = (e.Row.DataItem as Ia.Ngn.Cl.Model.Ui.Nokia.Subscriber);
 637:                              break;
 638:                          }
 639:                      case "nddOntGridView":
 640:                          {
 641:                              nddOnt = (e.Row.DataItem as Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont);
 642:                              break;
 643:                          }
 644:                      case "ontGridView":
 645:                          {
 646:                              ont = (e.Row.DataItem as Ia.Ngn.Cl.Model.Ont);
 647:                              break;
 648:                          }
 649:                      case "ontOntPotsGridView":
 650:                          {
 651:                              ontOntPots = (e.Row.DataItem as Ia.Ngn.Cl.Model.OntOntPots);
 652:                              break;
 653:                          }
 654:                      case "serviceRequestServiceGridView":
 655:                          {
 656:                              serviceRequestService = (e.Row.DataItem as Ia.Ngn.Cl.Model.Ui.ServiceRequestService);
 657:                              break;
 658:                          }
 659:                      case "accessGridView":
 660:                          {
 661:                              access = (e.Row.DataItem as Ia.Ngn.Cl.Model.Access);
 662:                              break;
 663:                          }
 664:                      case "serviceGridView":
 665:                          {
 666:                              service2 = (e.Row.DataItem as Ia.Ngn.Cl.Model.Ui.Service2);
 667:                              break;
 668:                          }
 669:                      case "ontServiceVoipGridView":
 670:                          {
 671:                              ontServiceVoip = (e.Row.DataItem as Ia.Ngn.Cl.Model.OntServiceVoip);
 672:                              break;
 673:                          }
 674:                      case "emsDevGridView":
 675:                          {
 676:                              emsDev = (e.Row.DataItem as Ia.Ngn.Cl.Model.Huawei.EmsDev);
 677:                              break;
 678:                          }
 679:                      case "emsBoardGridView":
 680:                          {
 681:                              emsBoard = (e.Row.DataItem as Ia.Ngn.Cl.Model.Huawei.EmsBoard);
 682:                              break;
 683:                          }
 684:                      case "emsPortGridView":
 685:                          {
 686:                              emsPort = (e.Row.DataItem as Ia.Ngn.Cl.Model.Huawei.EmsPort);
 687:                              break;
 688:                          }
 689:                      case "emsOntGridView":
 690:                          {
 691:                              emsOnt = (e.Row.DataItem as Ia.Ngn.Cl.Model.Ui.Huawei.EmsOnt);
 692:                              break;
 693:                          }
 694:                      case "emsOntSipInfoGridView":
 695:                          {
 696:                              emsOntSipInfo = (e.Row.DataItem as Ia.Ngn.Cl.Model.Huawei.EmsOntSipInfo);
 697:                              break;
 698:                          }
 699:                      case "emsVoipPstnUserGridView":
 700:                          {
 701:                              emsVoipPstnUser = (e.Row.DataItem as Ia.Ngn.Cl.Model.Huawei.EmsVoipPstnUser);
 702:                              break;
 703:                          }
 704:                      case "staffGridView":
 705:                          {
 706:                              staff = (e.Row.DataItem as Ia.Ngn.Cl.Model.Staff);
 707:                              break;
 708:                          }
 709:                      case "contactGridView":
 710:                          {
 711:                              contact = (e.Row.DataItem as Ia.Ngn.Cl.Model.Contact);
 712:                              break;
 713:                          }
 714:                      case "userGridView":
 715:                          {
 716:                              membershipUser = (e.Row.DataItem as MembershipUser);
 717:                              break;
 718:                          }
 719:                      case "accessFamilyTypeInAreaBlockGridView":
 720:                          {
 721:                              accessFamilyTypeInAreaBlock = (e.Row.DataItem as Ia.Ngn.Cl.Model.Ui.Maintenance.AccessFamilyTypeAreaBlock);
 722:                              break;
 723:                          }
 724:                      case "newOntEventGridView":
 725:                          {
 726:                              newOntEvent = (e.Row.DataItem as Ia.Ngn.Cl.Model.Ui.Event);
 727:                              break;
 728:                          }
 729:                      case "staffFrameworkPerformanceGridView":
 730:                          {
 731:                              if (e.Row.DataItem != null) userId = Guid.TryParse((e.Row.DataItem as Ia.Ngn.Cl.Model.Ui.Performance).UserId.ToString(), out _userId) ? _userId : Guid.Empty;
 732:                              break;
 733:                          }
 734:                      case "kuwaitNgnAreaGridView":
 735:                          {
 736:                              if (e.Row.DataItem != null) kuwaitNgnArea = (Ia.Ngn.Cl.Model.Business.Service.KuwaitNgnArea)e.Row.DataItem;
 737:                              break;
 738:                          }
 739:                      case "serviceExemptionGridView":
 740:                          {
 741:                              serviceExemption = (e.Row.DataItem as Ia.Ngn.Cl.Model.ServiceExemption);
 742:                              break;
 743:                          }
 744:                      case "serviceAccessNameGridView":
 745:                          {
 746:                              serviceAccessName = (e.Row.DataItem as Ia.Ngn.Cl.Model.Business.ServiceAccessName);
 747:                              break;
 748:                          }
 749:                      default:
 750:                          {
 751:                              senderKnown = false;
 752:                              break;
 753:                          }
 754:                  }
 755:   
 756:                  if (senderKnown)
 757:                  {
 758:                      if (e.Row.RowType == DataControlRowType.Header)
 759:                      {
 760:                          if (buttonColumnType == GridViewButtonColumnType.NoButtons)
 761:                          {
 762:                          }
 763:                          else if (buttonColumnType == GridViewButtonColumnType.HistoryButton)
 764:                          {
 765:                              // below: for the header just keep the first column visible
 766:                              e.Row.Cells[0].Visible = true;
 767:                          }
 768:                          else if (buttonColumnType == GridViewButtonColumnType.DeleteAndDeleteOffButton)
 769:                          {
 770:                              // below: for the header just keep one (first) column visible
 771:                              e.Row.Cells[0].Visible = true;
 772:                              e.Row.Cells[1].Visible = false;
 773:                          }
 774:                          else if (buttonColumnType == GridViewButtonColumnType.DeleteAndDeleteOffAndDeleteChildOffAndHistoryButtons)
 775:                          {
 776:                              // below: for the header just keep one (first) column visible
 777:                              e.Row.Cells[0].Visible = true; // first visible
 778:                              e.Row.Cells[1].Visible = false; // second hidden
 779:                              e.Row.Cells[2].Visible = false; // third hidden
 780:                          }
 781:                          else if (buttonColumnType == GridViewButtonColumnType.DeleteAndEditAndCancelAndUpdateButtons)
 782:                          {
 783:                          }
 784:                      }
 785:                      else if (e.Row.RowType == DataControlRowType.DataRow)
 786:                      {
 787:                          if (buttonColumnType == GridViewButtonColumnType.NoButtons)
 788:                          {
 789:                          }
 790:                          else if (buttonColumnType == GridViewButtonColumnType.HistoryButton)
 791:                          {
 792:                          }
 793:                          else if (buttonColumnType == GridViewButtonColumnType.DeleteAndDeleteOffButton)
 794:                          {
 795:                              // below: manage the delete button according to the role of user
 796:                              if (Ia.Ngn.Cl.Model.Business.Authority.StaffCanCreateReadUpdateDeleteReportHistory(Ia.Ngn.Cl.Model.Business.Authority.PersistentStorageFunction.Delete, report, reportHistory, staffMembershipUser))
 797:                              {
 798:                                  if (reportHistory.Report.StatusIsOpen)
 799:                                  {
 800:                                      // below: report status open
 801:                                      e.Row.Cells[0].Visible = true; // delete is visible
 802:                                      e.Row.Cells[1].Visible = false; // delete-off is hidden
 803:                                  }
 804:                                  else
 805:                                  {
 806:                                      // below: report closed, hence can not delete histories
 807:                                      e.Row.Cells[0].Visible = false; // delete is hidden
 808:                                      e.Row.Cells[1].Visible = true; // delete-off is visible
 809:                                  }
 810:                              }
 811:                              else
 812:                              {
 813:                                  e.Row.Cells[0].Visible = false; // delete is hidden
 814:                                  e.Row.Cells[1].Visible = true; // delete-off is visible
 815:                              }
 816:                          }
 817:                          else if (buttonColumnType == GridViewButtonColumnType.DeleteAndDeleteOffAndDeleteChildOffAndHistoryButtons)
 818:                          {
 819:                              // below: manage the delete button according to the role of user
 820:                              if (Ia.Ngn.Cl.Model.Business.Authority.StaffCanCreateReadUpdateDeleteReport(Ia.Ngn.Cl.Model.Business.Authority.PersistentStorageFunction.Delete, report, staffMembershipUser))
 821:                              {
 822:                                  if (report.StatusIsOpen)
 823:                                  {
 824:                                      if (report.ReportHistories != null && report.ReportHistories.Count > 0)
 825:                                      {
 826:                                          // below: has children
 827:                                          e.Row.Cells[0].Visible = false; // delete is hidden
 828:                                          e.Row.Cells[1].Visible = false; // delete-off is hidden
 829:                                          e.Row.Cells[2].Visible = true;  // delete-child-off is visible
 830:                                      }
 831:                                      else
 832:                                      {
 833:                                          // below: no children
 834:                                          e.Row.Cells[0].Visible = true; // delete is visible
 835:                                          e.Row.Cells[1].Visible = false; // delete-off is hidden
 836:                                          e.Row.Cells[2].Visible = false; // delete-child-off is hidden
 837:                                      }
 838:                                  }
 839:                                  else
 840:                                  {
 841:                                      // below: report is closed, hence can not delete histories
 842:                                      e.Row.Cells[0].Visible = false; // delete is hidden
 843:                                      e.Row.Cells[1].Visible = true; // delete-off is visible
 844:                                      e.Row.Cells[2].Visible = false;  // delete-child-off is hidden
 845:                                  }
 846:                              }
 847:                              else
 848:                              {
 849:                                  e.Row.Cells[0].Visible = false; // delete is hidden
 850:                                  e.Row.Cells[1].Visible = true; // delete-off is visible
 851:                                  e.Row.Cells[2].Visible = false; // delete-child-off is hidden
 852:                              }
 853:                          }
 854:                          else if (buttonColumnType == GridViewButtonColumnType.DeleteAndEditAndCancelAndUpdateButtons)
 855:                          {
 856:                          }
 857:   
 858:   
 859:                          if (report != null)
 860:                          {
 861:                              if (staffMembershipUser != null)
 862:                              {
 863:                                  if (Ia.Ngn.Cl.Model.Data.Report.ReportResponsibilityByStaffGuidDictionary.ContainsKey(staffMembershipUser.UserId))
 864:                                  {
 865:                                      if (Ia.Ngn.Cl.Model.Data.Report.ReportResponsibilityByStaffGuidDictionary[staffMembershipUser.UserId].Any(u => u == report.Id))
 866:                                      {
 867:                                          e.Row.CssClass = "selected-row-style";
 868:                                      }
 869:                                      else { }
 870:                                  }
 871:                                  else { }
 872:                              }
 873:                              else { }
 874:                          }
 875:                          else { }
 876:   
 877:   
 878:                          foreach (Control control in e.Row.Controls)
 879:                          {
 880:                              try
 881:                              {
 882:                                  if (control.Controls.Count > 0)
 883:                                  {
 884:                                      if (control.Controls[0].GetType().ToString() == "System.Web.UI.WebControls.Label")
 885:                                      {
 886:                                          Label l = (Label)control.Controls[0];
 887:   
 888:                                          switch (l.ID)
 889:                                          {
 890:                                              case "reportServiceLabel":
 891:                                                  {
 892:                                                      s = Ia.Ngn.Cl.Model.Business.Service.ServiceName(report.Service, report.ServiceType);
 893:                                                      l.Text = s;
 894:                                                      break;
 895:                                                  }
 896:                                              case "reportStatusLabel": l.Text = Ia.Ngn.Cl.Model.Data.Report.StatusColoredDictionary[report.Status].ToString(); break;
 897:                                              case "reportSeverityLabel": l.Text = Ia.Ngn.Cl.Model.Data.Report.SeverityColoredDictionary[report.Severity].ToString(); break;
 898:                                              case "reportCategoryLabel": l.Text = Ia.Ngn.Cl.Model.Data.Report.CategoryDictionary[report.Category].ToString(); break;
 899:                                              case "reportAreaLabel": l.Text = Ia.Ngn.Cl.Model.Data.Report.CategoryAreaColoredDictionary[report.Area].ToString(); break;
 900:                                              case "reportPriorityLabel": l.Text = Ia.Ngn.Cl.Model.Data.Report.PriorityColoredDictionary[report.Priority].ToString(); break;
 901:                                              case "reportDetailLabel": l.Text = Ia.Cl.Model.Html.Decode(report.Detail); break;
 902:                                              case "reportLastHistoricResolutionLabel": l.Text = (report.LastReportHistory != null) ? Ia.Ngn.Cl.Model.Data.Report.ResolutionEnglishAndArabicColoredDictionary[report.LastReportHistory.Resolution].ToString() : ""; break;
 903:   
 904:                                              case "reportStatusLastHistoricResolutionLabel":
 905:                                                  {
 906:                                                      s = Ia.Ngn.Cl.Model.Data.Report.StatusColoredDictionary[report.Status].ToString();
 907:   
 908:                                                      if (report.LastReportHistory != null) s += "/" + Ia.Ngn.Cl.Model.Data.Report.ResolutionEnglishAndArabicColoredDictionary[report.LastReportHistory.Resolution].ToString();
 909:   
 910:                                                      l.Text = s;
 911:   
 912:                                                      break;
 913:                                                  }
 914:   
 915:                                              case "reportLastHistoricalIndicationActionResolutionLabel":
 916:                                                  {
 917:                                                      if (report.LastReportHistory != null)
 918:                                                      {
 919:                                                          s = Ia.Ngn.Cl.Model.Data.Report.IndicationColoredDictionary[report.LastReportHistory.Indication].ToString()
 920:                                                              + "/" + Ia.Ngn.Cl.Model.Data.Report.ActionColoredDictionary[report.LastReportHistory.Action].ToString()
 921:                                                              + "/" + Ia.Ngn.Cl.Model.Data.Report.ResolutionColoredDictionary[report.LastReportHistory.Resolution].ToString();
 922:                                                      }
 923:                                                      else s = string.Empty;
 924:   
 925:                                                      l.Text = s;
 926:   
 927:                                                      break;
 928:                                                  }
 929:   
 930:                                              case "reportAccessServiceRequestLastHistoricResolutionLabel": l.Text = (reportAccessServiceRequest.Report.LastReportHistory != null) ? Ia.Ngn.Cl.Model.Data.Report.ResolutionEnglishAndArabicColoredDictionary[reportAccessServiceRequest.Report.LastReportHistory.Resolution].ToString() : ""; break;
 931:                                              case "reportAccessServiceRequestServiceFlatTermIdLabel": l.Text = "?"; break;
 932:                                              case "reportAccessServiceRequestLastHistoricActionLabel": l.Text = (reportAccessServiceRequest.Report.LastReportHistory != null) ? Ia.Ngn.Cl.Model.Data.Report.ActionColoredDictionary[reportAccessServiceRequest.Report.LastReportHistory.Action].ToString() : ""; break;
 933:                                              case "reportAccessServiceRequestServiceTypeLabel": l.Text = reportAccessServiceRequest.Report.ServiceType.ToString(); break;
 934:                                              case "reportAccessServiceRequestContactLabel": l.Text = Ia.Cl.Model.Html.Decode(reportAccessServiceRequest.Report.Contact); break;
 935:                                              case "reportAccessServiceRequestAddressLabel": l.Text = Ia.Cl.Model.Html.Decode(reportAccessServiceRequest.Access.Address); break;
 936:                                              case "reportAccessServiceRequestDetailLabel": l.Text = (reportAccessServiceRequest.Report.LastReportHistory != null) ? Ia.Cl.Model.Html.Decode(reportAccessServiceRequest.Report.LastReportHistory.Detail) : ""; break;
 937:                                              case "reportAccessServiceRequestNoteLabel": l.Text = (reportAccessServiceRequest.Report.LastReportHistory != null) ? Ia.Cl.Model.Html.Decode(reportAccessServiceRequest.Report.LastReportHistory.Note) : ""; break;
 938:                                              case "reportAccessServiceRequestStaffFrameworkLabel":
 939:                                                  {
 940:                                                      if (reportAccessServiceRequest.Report.LastReportHistory != null)
 941:                                                      {
 942:                                                          if (Ia.Ngn.Cl.Model.Business.Administration.IsFrameworkGuid(reportAccessServiceRequest.Report.LastReportHistory.UserId))
 943:                                                          {
 944:                                                              l.Text = (from f in Ia.Ngn.Cl.Model.Data.Administration.FrameworkList where f.Guid == reportAccessServiceRequest.Report.LastReportHistory.UserId select f.ArabicName).SingleOrDefault();
 945:                                                          }
 946:                                                          else l.Text = (from _s in Ia.Ngn.Cl.Model.Data.Staff.List where _s.UserId == reportAccessServiceRequest.Report.LastReportHistory.UserId select _s.FirstAndMiddleName).SingleOrDefault();
 947:                                                      }
 948:                                                      else
 949:                                                      {
 950:                                                          l.Text = "";
 951:                                                      }
 952:   
 953:                                                      break;
 954:                                                  }
 955:   
 956:                                              case "reportLastHistoricEstimateLabel": l.Text = (report.LastReportHistory != null) ? l.Text = Ia.Ngn.Cl.Model.Data.Report.EstimateColoredDictionary[report.LastReportHistory.Estimate].ToString() : ""; break;
 957:                                              case "reportLastHistoricStaffLabel": l.Text = (report.LastReportHistory != null) ? l.Text = (from _s in Ia.Ngn.Cl.Model.Data.Staff.List where _s.UserId == report.LastReportHistory.UserId select _s.FirstAndMiddleName).SingleOrDefault() : ""; break;
 958:                                              case "reportLastReportAndHistoricStaffFrameworkLabel":
 959:                                                  {
 960:                                                      if (report.LastReportHistory != null)
 961:                                                      {
 962:                                                          if (Ia.Ngn.Cl.Model.Business.Administration.IsFrameworkGuid(report.LastReportHistory.UserId))
 963:                                                          {
 964:                                                              l.Text = (from f in Ia.Ngn.Cl.Model.Data.Administration.FrameworkList where f.Guid == report.LastReportHistory.UserId select f.ArabicName).SingleOrDefault();
 965:                                                          }
 966:                                                          else l.Text = (from _s in Ia.Ngn.Cl.Model.Data.Staff.List where _s.UserId == report.LastReportHistory.UserId select _s.FirstAndMiddleName).SingleOrDefault();
 967:                                                      }
 968:                                                      else
 969:                                                      {
 970:                                                          if (Ia.Ngn.Cl.Model.Business.Administration.IsFrameworkGuid(report.UserId))
 971:                                                          {
 972:                                                              l.Text = (from f in Ia.Ngn.Cl.Model.Data.Administration.FrameworkList where f.Guid == report.UserId select f.ArabicName).SingleOrDefault();
 973:                                                          }
 974:                                                          else l.Text = (from _s in Ia.Ngn.Cl.Model.Data.Staff.List where _s.UserId == report.UserId select _s.FirstAndMiddleName).SingleOrDefault();
 975:                                                      }
 976:   
 977:                                                      break;
 978:                                                  }
 979:                                              case "reportContactLabel": l.Text = Ia.Cl.Model.Html.Decode(report.Contact); break;
 980:                                              case "reportNoteLabel": l.Text = Ia.Cl.Model.Html.Decode(report.Note); break;
 981:                                              case "reportHistoryIndicationLabel": l.Text = Ia.Ngn.Cl.Model.Data.Report.IndicationColoredDictionary[reportHistory.Indication].ToString(); break;
 982:                                              case "reportHistoryAreaLabel":
 983:                                                  {
 984:                                                      if (Ia.Ngn.Cl.Model.Data.Report.CategoryAreaColoredDictionary.ContainsKey(reportHistory.Area))
 985:                                                      {
 986:                                                          l.Text = Ia.Ngn.Cl.Model.Data.Report.CategoryAreaColoredDictionary[reportHistory.Area].ToString();
 987:                                                      }
 988:                                                      else l.Text = "Error: Area '" + reportHistory.Area + "' not found. ";
 989:   
 990:                                                      break;
 991:                                                  };
 992:                                              case "reportHistoryActionLabel": l.Text = Ia.Ngn.Cl.Model.Data.Report.ActionColoredDictionary[reportHistory.Action].ToString(); break;
 993:                                              case "reportHistoryResolutionLabel": l.Text = Ia.Ngn.Cl.Model.Data.Report.ResolutionEnglishAndArabicColoredDictionary[reportHistory.Resolution].ToString(); break;
 994:                                              case "reportHistoryEstimateLabel": l.Text = Ia.Ngn.Cl.Model.Data.Report.EstimateColoredDictionary[reportHistory.Estimate].ToString(); break;
 995:                                              case "reportHistoryDetailLabel": l.Text = Ia.Cl.Model.Html.Decode(reportHistory.Detail); break;
 996:                                              case "reportHistoryNoteLabel": l.Text = Ia.Cl.Model.Html.Decode(reportHistory.Note); break;
 997:                                              case "reportHistoryStaffFrameworkLabel":
 998:                                                  {
 999:                                                      if (Ia.Ngn.Cl.Model.Business.Administration.IsFrameworkGuid(reportHistory.UserId))
1000:                                                      {
1001:                                                          l.Text = (from f in Ia.Ngn.Cl.Model.Data.Administration.FrameworkList where f.Guid == reportHistory.UserId select f.ArabicName).SingleOrDefault();
1002:                                                      }
1003:                                                      else l.Text = (from _s in Ia.Ngn.Cl.Model.Data.Staff.List where _s.UserId == reportHistory.UserId select _s.FirstAndMiddleName).SingleOrDefault();
1004:   
1005:                                                      break;
1006:                                                  }
1007:                                              case "seruattrRouteNameLabel": l.Text = Ia.Ngn.Cl.Model.Business.Huawei.Seruattr.RnidxRouteName[seruattr.RNIDX2]; break;
1008:                                              case "serviceRequestStatusLabel": l.Text = Ia.Ngn.Cl.Model.Data.ServiceRequest.StatusSortedList[serviceRequest.Status].ToString(); break;
1009:                                              case "serviceRequestCustomerCategoryIdLabel": l.Text = Ia.Ngn.Cl.Model.Data.ServiceRequest.CustomerCategorySortedList[serviceRequest.CustomerCategoryId].ToString(); break;
1010:                                              case "serviceRequestServiceIdLabel":
1011:                                                  {
1012:                                                      if (Ia.Ngn.Cl.Model.Data.ServiceRequest.ServiceSortedList.ContainsKey(serviceRequest.ServiceId))
1013:                                                      {
1014:                                                          l.Text = Ia.Ngn.Cl.Model.Data.ServiceRequest.ServiceSortedList[serviceRequest.ServiceId].ToString();
1015:                                                      }
1016:                                                      else l.Text = "Error: Service '" + serviceRequest.ServiceId + "' not found. ";
1017:   
1018:                                                      break;
1019:                                                  };
1020:   
1021:                                              case "staffFrameworkPerformanceStaffLabel": l.Text = (userId != Guid.Empty) ? l.Text = (from _s in Ia.Ngn.Cl.Model.Data.Staff.List where _s.UserId == userId select _s.FirstAndMiddleName).SingleOrDefault() : ""; break;
1022:   
1023:                                              case "serviceRequestHistoryStatusLabel": l.Text = Ia.Ngn.Cl.Model.Data.ServiceRequest.SystemCode[serviceRequestHistory.Status].ToString(); break;
1024:                                              case "serviceRequestHistoryEndDateTimeLabel":
1025:                                                  {
1026:                                                      if (serviceRequestHistory.EndDateTime == Ia.Ngn.Cl.Model.Business.Administration.SqlFriendlyJanuary1st1753NullDateTime)
1027:                                                      {
1028:                                                          l.Text = string.Empty;
1029:                                                      }
1030:                                                      else l.Text = serviceRequestHistory.EndDateTime.ToString("yyyy-MM-dd");
1031:   
1032:                                                      break;
1033:                                                  };
1034:                                              case "serviceRequestHistoryServiceIdLabel":
1035:                                                  {
1036:                                                      if (Ia.Ngn.Cl.Model.Data.ServiceRequest.ServiceSortedList.ContainsKey(serviceRequestHistory.ServiceId))
1037:                                                      {
1038:                                                          l.Text = Ia.Ngn.Cl.Model.Data.ServiceRequest.ServiceSortedList[serviceRequestHistory.ServiceId].ToString();
1039:                                                      }
1040:                                                      else l.Text = "Error: Service '" + serviceRequestHistory.ServiceId + "' not found. ";
1041:   
1042:                                                      break;
1043:                                                  };
1044:                                              case "serviceRequestHistoryServiceCategoryIdLabel": l.Text = Ia.Ngn.Cl.Model.Data.ServiceRequest.ServiceCategorySortedList[serviceRequestHistory.ServiceCategoryId].ToString(); break;
1045:   
1046:                                              case "serviceRequestServiceCategoryIdLabel": l.Text = Ia.Ngn.Cl.Model.Data.ServiceRequest.ServiceCategorySortedList[serviceRequest.ServiceCategoryId].ToString(); break;
1047:                                              case "serviceRequestCustomerNameLabel": l.Text = serviceRequest.CustomerName; break;
1048:                                              case "serviceRequestServiceServiceTypeLabel": l.Text = Ia.Ngn.Cl.Model.Data.ServiceRequest.ServiceSortedList[serviceRequestService.ServiceType].ToString(); break;
1049:                                              case "serviceRequestServiceTypeLabel": l.Text = "??"; break;
1050:                                              case "serviceRequestServiceProvisionedLabel": l.Text = Ia.Cl.Model.Default.YesNo(serviceRequestService.Provisioned); break;
1051:                                              case "serviceRequestServiceCallWaitingLabel": l.Text = Ia.Cl.Model.Default.YesNo(serviceRequestService.CallWaiting); break;
1052:                                              case "serviceRequestServiceCallForwardingLabel": l.Text = Ia.Cl.Model.Default.YesNo(serviceRequestService.CallForwarding); break;
1053:                                              case "serviceRequestServiceAlarmCallLabel": l.Text = Ia.Cl.Model.Default.YesNo(serviceRequestService.AlarmCall); break;
1054:                                              case "serviceRequestServiceInternationalCallingUserControlledLabel": l.Text = Ia.Cl.Model.Default.YesNo(serviceRequestService.InternationalCallingUserControlled); break;
1055:                                              case "serviceRequestServiceInternationalCallingLabel": l.Text = Ia.Cl.Model.Default.YesNo(serviceRequestService.InternationalCalling); break;
1056:                                              case "serviceRequestServiceCallerIdLabel": l.Text = Ia.Cl.Model.Default.YesNo(serviceRequestService.CallerId); break;
1057:                                              case "serviceRequestServiceConferenceCallLabel": l.Text = Ia.Cl.Model.Default.YesNo(serviceRequestService.ConferenceCall); break;
1058:                                              case "serviceRequestServiceAbbriviatedCallingLabel": l.Text = Ia.Cl.Model.Default.YesNo(serviceRequestService.AbbriviatedCalling); break;
1059:                                              case "serviceRequestServiceCallBarringLabel": l.Text = Ia.Cl.Model.Default.YesNo(serviceRequestService.CallBarring); break;
1060:                                              case "serviceRequestServiceServiceSuspensionLabel": l.Text = Ia.Cl.Model.Default.YesNo(serviceRequestService.ServiceSuspension); break;
1061:   
1062:                                              case "accessAreaLabel": l.Text = (from kna in Ia.Ngn.Cl.Model.Data.Service.KuwaitNgnAreaList where kna.Id == access.AreaId select kna.ArabicName).SingleOrDefault(); break;
1063:                                              case "accessOltLabel": l.Text = (from o in Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.OltList where o.Id == access.Olt select o.AmsName).SingleOrDefault(); break;
1064:                                              case "accessBlockLabel": l.Text = access.Block.ToString(); break;
1065:                                              case "accessStreetLabel": l.Text = access.Street; break;
1066:                                              case "accessPremisesOldLabel": l.Text = access.PremisesOld; break;
1067:                                              case "accessPremisesNewLabel": l.Text = access.PremisesNew; break;
1068:                                              case "accessPaciLabel": l.Text = access.Paci; break;
1069:                                              case "accessNoteLabel": l.Text = access.Note; break;
1070:                                              case "accessStaffNameLabel": l.Text = (from _s in Ia.Ngn.Cl.Model.Data.Staff.List where _s.UserId == access.UserId select _s.FirstName).SingleOrDefault(); break;
1071:                                              case "accessOntFamilyTypeCapacityLabel":
1072:                                                  {
1073:                                                      // temp: later quickly find vendor from accessId
1074:                                                      if (access.Onts != null && access.Onts.Count > 0)
1075:                                                      {
1076:                                                          l.Text = Ia.Ngn.Cl.Model.Data.Nokia.Ont.FamilyTypeFromId(access.Onts.FirstOrDefault().FamilyTypeId);
1077:   
1078:                                                          l.Text += " (" + Ia.Ngn.Cl.Model.Business.Nokia.Ams.PossibleNumberOfTdForOntFamilyType(access.Onts.FirstOrDefault().FamilyTypeId) + ")";
1079:                                                      }
1080:                                                      else if (access.EmsOnts != null && access.EmsOnts.Count > 0)
1081:                                                      {
1082:                                                          l.Text = Ia.Ngn.Cl.Model.Business.Huawei.Ont.FamilyTypeStringFromEquipmentType(access.EmsOnts.FirstOrDefault().EquipmentType);
1083:   
1084:                                                          l.Text += " (" + Ia.Ngn.Cl.Model.Business.Huawei.Ems.PossibleNumberOfTdForOntEquipmentType(access.EmsOnts.FirstOrDefault().EquipmentType) + ")";
1085:                                                      }
1086:                                                      else l.Text = "";
1087:   
1088:                                                      break;
1089:                                                  }
1090:   
1091:                                              case "accessFamilyTypeInAreaBlockLabel": l.Text = (from kna in Ia.Ngn.Cl.Model.Data.Service.KuwaitNgnAreaList where kna.Id == accessFamilyTypeInAreaBlock.AreaId select kna.NameArabicName).SingleOrDefault(); break;
1092:   
1093:                                              case "service2ServiceTypeLabel": l.Text = Ia.Ngn.Cl.Model.Data.Service.ServiceType(service2.ServiceType).ColoredNameArabicName; break;
1094:                                              case "service2CallWaitingLabel": l.Text = Ia.Cl.Model.Default.YesNo(service2.CallWaiting); break;
1095:                                              case "service2CallForwardingLabel": l.Text = Ia.Cl.Model.Default.YesNo(service2.CallForwarding); break;
1096:                                              case "service2AlarmCallLabel": l.Text = Ia.Cl.Model.Default.YesNo(service2.AlarmCall); break;
1097:                                              case "service2InternationalCallingUserControlledLabel": l.Text = Ia.Cl.Model.Default.YesNo(service2.InternationalCallingUserControlled); break;
1098:                                              case "service2InternationalCallingLabel": l.Text = Ia.Cl.Model.Default.YesNo(service2.InternationalCalling); break;
1099:                                              case "service2CallerIdLabel": l.Text = Ia.Cl.Model.Default.YesNo(service2.CallerId); break;
1100:                                              case "service2ConferenceCallLabel": l.Text = Ia.Cl.Model.Default.YesNo(service2.ConferenceCall); break;
1101:                                              case "service2AbbriviatedCallingLabel": l.Text = Ia.Cl.Model.Default.YesNo(service2.AbbriviatedCalling); break;
1102:                                              case "service2CallBarringLabel": l.Text = Ia.Cl.Model.Default.YesNo(service2.CallBarring); break;
1103:                                              case "service2ServiceSuspensionLabel": l.Text = Ia.Cl.Model.Default.YesNo(service2.ServiceSuspension); break;
1104:   
1105:                                              case "isPrimaryAgcfGatewayRecordLabel": l.Text = Ia.Cl.Model.Default.YesNo(agcfGatewayRecord.IsPrimary); break;
1106:   
1107:                                              case "ontFamilyTypeLabel": l.Text = Ia.Ngn.Cl.Model.Data.Nokia.Ont.FamilyTypeFromId(ont.FamilyTypeId); break;
1108:                                              case "ontStateIdLabel": l.Text = Ia.Ngn.Cl.Model.Data.Nokia.Ams.BellcoreStateFromId(ont.StateId); break;
1109:                                              case "ontServiceVoipStateIdLabel": l.Text = Ia.Ngn.Cl.Model.Data.Nokia.Ams.BellcoreStateFromId(ontServiceVoip.StateId); break;
1110:                                              case "ontServiceVoipMgcIpLabel": l.Text = ontServiceVoip.MgcIp; break;
1111:                                              case "ontOntPotsStateIdLabel": l.Text = Ia.Ngn.Cl.Model.Data.Nokia.Ams.BellcoreStateFromId(ontOntPots.StateId); break;
1112:                                              case "ontVendorLabel": l.Text = Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.VendorNameFromId(ont.VendorId); break;
1113:   
1114:                                              case "userNameLabel": l.Text = membershipUser.UserName; break;
1115:                                              case "userEmailLabel": l.Text = membershipUser.Email; break;
1116:   
1117:                                              case "staffIsHeadLabel": l.Text = Ia.Cl.Model.Default.YesNoInArabic(staff.IsHead); break;
1118:                                              case "staffFirstNameLabel": l.Text = staff.FirstName; break;
1119:                                              case "staffMiddleNameLabel": l.Text = staff.MiddleName; break;
1120:                                              case "staffLastNameLabel": l.Text = staff.LastName; break;
1121:                                              case "staffIpPbxExtensionLabel": l.Text = staff.IpPbxExtension; break;
1122:                                              case "staffEmploymentIdLabel": l.Text = staff.EmploymentId.ToString(); break;
1123:                                              case "staffAdministrativeFrameworkIdLabel": l.Text = (from f in Ia.Ngn.Cl.Model.Data.Administration.FrameworkList where f.Id == staff.AdministrativeFrameworkId select f.ArabicName).SingleOrDefault(); break;
1124:                                              case "staffIdentityUserIdLabel": l.Text = Ia.Cl.Model.Identity.UserNameDictionary[staff.UserId]; break;
1125:                                              case "staffUserEmailLabel":
1126:                                                  {
1127:                                                      userList = Ia.Cl.Model.Identity.UserList;
1128:   
1129:                                                      l.Text = (from u in userList where u.ProviderUserKey == staff.UserId select u.Email).SingleOrDefault();
1130:                                                      break;
1131:                                                  }
1132:   
1133:                                              case "contactFirstNameLabel": l.Text = contact.FirstName; break;
1134:                                              case "contactMiddleNameLabel": l.Text = contact.MiddleName; break;
1135:                                              case "contactLastNameLabel": l.Text = contact.LastName; break;
1136:                                              case "contactCompanyLabel": l.Text = contact.Company; break;
1137:                                              case "contactEmailLabel": l.Text = contact.Email; break;
1138:                                              case "contactPhoneLabel": l.Text = contact.Phone; break;
1139:                                              case "contactAddressLabel": l.Text = contact.Address; break;
1140:                                              case "contactApprovedLabel": l.Text = Ia.Cl.Model.Default.YesNoInArabic(contact.IsApproved); break;
1141:                                              case "contactUrlLabel": l.Text = contact.Url; break;
1142:                                              case "contactNoteLabel": l.Text = contact.Note; break;
1143:                                              case "contactUserIdLabel": l.Text = contact.UserId.ToString(); break;
1144:   
1145:                                              case "reportUserNameLabel": l.Text = "?"; break;
1146:                                              case "reportStaffFrameworkLabel":
1147:                                                  {
1148:                                                      if (Ia.Ngn.Cl.Model.Business.Administration.IsFrameworkGuid(report.UserId))
1149:                                                      {
1150:                                                          l.Text = (from f in Ia.Ngn.Cl.Model.Data.Administration.FrameworkList where f.Guid == report.UserId select f.ArabicName).SingleOrDefault();
1151:                                                      }
1152:                                                      else l.Text = (from _s in Ia.Ngn.Cl.Model.Data.Staff.List where _s.UserId == report.UserId select _s.FirstAndMiddleName).SingleOrDefault();
1153:   
1154:                                                      if (report.LastReportHistory.UserId == staffMembershipUser.UserId)
1155:                                                      {
1156:                                                          //e.Row.BackColor = System.Drawing.Color.SlateGray;
1157:                                                      }
1158:   
1159:                                                      break;
1160:                                                  }
1161:                                              case "accessAreaStatisticLabel": l.Text = (from kna in Ia.Ngn.Cl.Model.Data.Service.KuwaitNgnAreaList where kna.Id == areaId select kna.ArabicName).SingleOrDefault(); break;
1162:   
1163:   
1164:                                              case "subscriberCallWaitingLabel":
1165:                                                  {
1166:                                                      l.Text = Ia.Cl.Model.Default.YesNo(subscriber.CallWaiting);
1167:   
1168:                                                      break;
1169:                                                  }
1170:                                              case "subPartyIsSipLabel":
1171:                                                  {
1172:                                                      l.Text = Ia.Cl.Model.Default.YesNo(Ia.Ngn.Cl.Model.Business.Nokia.SubParty.IsSip(subParty.PrimaryPUIDCPEProfileNumber));
1173:   
1174:                                                      break;
1175:                                                  }
1176:                                              case "subscriberCallForwardingLabel":
1177:                                                  {
1178:                                                      l.Text = Ia.Cl.Model.Default.YesNo(subscriber.CallForwarding);
1179:   
1180:                                                      break;
1181:                                                  }
1182:                                              case "subscriberAlarmCallLabel":
1183:                                                  {
1184:                                                      l.Text = Ia.Cl.Model.Default.YesNo(subscriber.AlarmCall);
1185:   
1186:                                                      break;
1187:                                                  }
1188:                                              case "subscriberInternationalCallingUserControlledLabel":
1189:                                                  {
1190:                                                      l.Text = Ia.Cl.Model.Default.YesNo(subscriber.InternationalCallingUserControlled);
1191:   
1192:                                                      break;
1193:                                                  }
1194:                                              case "subscriberInternationalCallingLabel":
1195:                                                  {
1196:                                                      l.Text = Ia.Cl.Model.Default.YesNo(subscriber.InternationalCalling);
1197:   
1198:                                                      break;
1199:                                                  }
1200:                                              case "subscriberCallerIdLabel":
1201:                                                  {
1202:                                                      l.Text = Ia.Cl.Model.Default.YesNo(subscriber.CallerId);
1203:   
1204:                                                      break;
1205:                                                  }
1206:                                              case "subscriberConferenceCallLabel":
1207:                                                  {
1208:                                                      l.Text = Ia.Cl.Model.Default.YesNo(subscriber.ConferenceCall);
1209:   
1210:                                                      break;
1211:                                                  }
1212:                                              case "subscriberAbbriviatedCallingLabel":
1213:                                                  {
1214:                                                      l.Text = Ia.Cl.Model.Default.YesNo(subscriber.AbbriviatedCalling);
1215:   
1216:                                                      break;
1217:                                                  }
1218:                                              case "subscriberCallBarringLabel":
1219:                                                  {
1220:                                                      l.Text = "?"; // Ia.Cl.Model.Default.YesNo(subscriber.??);
1221:   
1222:                                                      break;
1223:                                                  }
1224:                                              case "subscriberServiceSuspensionLabel":
1225:                                                  {
1226:                                                      l.Text = "?"; // Ia.Cl.Model.Default.YesNo(subscriber.ServiceSuspension);
1227:   
1228:                                                      break;
1229:                                                  }
1230:   
1231:   
1232:                                              case "nddOntPonPositionLabel": l.Text = nddOnt.Pon.Position; break;
1233:                                              case "nddOntPonOltOdfSiteNameLabel": l.Text = nddOnt.Pon.PonGroup.Olt.Odf.Router.Site.Name; break;
1234:                                              case "nddOntPonOltOdfSiteNameArabicNameLabel": l.Text = nddOnt.Pon.PonGroup.Olt.Odf.Router.Site.Name + " (" + nddOnt.Pon.PonGroup.Olt.Odf.Router.Site.ArabicName + ")"; break;
1235:                                              case "nddOntPonOltAmsNameLabel": l.Text = nddOnt.Pon.PonGroup.Olt.AmsName; break;
1236:                                              case "nddOntPonOltAreaLabel": l.Text = nddOnt.Pon.PonGroup.Olt.Symbol; break;
1237:                                              case "nddOntPrimarySwitchLabel": l.Text = nddOnt.PrimarySwitch; break;
1238:                                              case "nddOntPonOltFieldTypeLabel": l.Text = Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.FieldTypeColoredString(nddOnt.Pon.PonGroup.Olt.FieldType); break;
1239:                                              case "nddOntPonOltIsSipLabel": l.Text = Ia.Cl.Model.Default.YesNo(nddOnt.Pon.PonGroup.Olt.IsSip); break;
1240:   
1241:                                              case "nddOntMgcIpLabel": l.Text = nddOnt.MgcIp; break;
1242:                                              case "nddOntMgcSecondaryIpLabel": l.Text = nddOnt.MgcSecondaryIp; break;
1243:                                              case "nddOntPonOltVlanLabel": l.Text = "?"; break; // nddOnt.Pon.PonGroup.Olt.Vlan.ToString(); break;
1244:                                              case "nddOntPonOltNetworkNumberLabel": l.Text = nddOnt.Pon.PonGroup.NetworkNumber; break;
1245:                                              case "nddOntPonOltGatewayIpLabel": l.Text = nddOnt.Pon.PonGroup.GatewayIp; break;
1246:                                              case "nddOntImsServiceLabel": l.Text = nddOnt.ImsService.ToString(); break;
1247:                                              case "nddOntImsFsdbLabel": l.Text = nddOnt.ImsFsdb; break;
1248:   
1249:                                              case "nddOntProposedNameLabel":
1250:                                                  {
1251:                                                      if (nddOnt.Pon.PonGroup.HasNewProposedPonList)
1252:                                                      {
1253:                                                          l.Text = nddOnt.Access.ProposedName;
1254:                                                      }
1255:                                                      else
1256:                                                      {
1257:                                                          ((GridView)e.Row.Parent.Parent).Columns[5].Visible = false;
1258:                                                          // 5 is position (0 based) of HeaderText="Proposed Name"
1259:                                                      }
1260:   
1261:                                                      break;
1262:                                                  }
1263:   
1264:                                              case "nddOntPonOltOdfAccessVendorNameLabel": l.Text = nddOnt.Pon.PonGroup.Olt.Odf.Vendor.Name; break;
1265:                                              case "nddOntPonOltOdfRouterSwitchVendorNameLabel": l.Text = nddOnt.Pon.PonGroup.Olt.Odf.Router.Vendor.Name; break;
1266:   
1267:                                              case "serviceExemptionNoteLabel": l.Text = serviceExemption.Note; break;
1268:                                              case "serviceExemptionStaffNameLabel": l.Text = (from _s in Ia.Ngn.Cl.Model.Data.Staff.List where _s.UserId == serviceExemption.UserId select _s.FirstName).SingleOrDefault(); break;
1269:   
1270:                                              case "serviceRequestOntAreaLabel": l.Text = (from kna in Ia.Ngn.Cl.Model.Data.Service.KuwaitNgnAreaList where kna.Symbol == serviceRequestOnt.AreaSymbol select kna.ArabicName).SingleOrDefault(); break;
1271:   
1272:                                              case "serviceRequestOntDetailServiceTypeLabel": l.Text = Ia.Ngn.Cl.Model.Data.ServiceRequest.ServiceSortedList[serviceRequestOntDetail.ServiceType].ToString(); break;
1273:   
1274:                                              default: break;
1275:                                          }
1276:   
1277:                                          /*
1278:                                          else if (l.ID == "service_request_ont_l")
1279:                                          {
1280:                                              // below: indicate if number is in customer dept ready database
1281:                                              if (drv["service_request_ont"] == DBNull.Value)
1282:                                              {
1283:                                                  l.Text = l.Text = "No";
1284:                                                  l.ForeColor = System.Drawing.Color.Red;
1285:                                              }
1286:                                              else
1287:                                              {
1288:                                                  l.Text = l.Text = "Ready (جاهز)";
1289:                                                  l.ForeColor = System.Drawing.Color.Green;
1290:                                              }
1291:                                          }
1292:                                           */
1293:                                      }
1294:                                      else if (control.Controls[0].GetType().ToString() == "System.Web.UI.WebControls.HyperLink")
1295:                                      {
1296:                                          HyperLink hl = (HyperLink)control.Controls[0];
1297:   
1298:                                          switch (hl.ID)
1299:                                          {
1300:                                              case "reportServiceHyperLink":
1301:                                                  {
1302:                                                      s = Ia.Ngn.Cl.Model.Business.Service.ServiceName(report.Service, report.ServiceType);
1303:                                                      hl.Text = s;
1304:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + s;
1305:                                                      break;
1306:                                                  }
1307:                                              case "reportAccessServiceRequestServiceHyperLink":
1308:                                                  {
1309:                                                      s = Ia.Ngn.Cl.Model.Business.Service.ServiceName(reportAccessServiceRequest.Report.Service, reportAccessServiceRequest.Report.ServiceType);
1310:                                                      hl.Text = s;
1311:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + s;
1312:                                                      break;
1313:                                                  }
1314:                                              case "serviceRequestNumberSerialHyperLink":
1315:                                                  {
1316:                                                      hl.Text = serviceRequest.Number + "/" + serviceRequest.Serial;
1317:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + serviceRequest.Number;
1318:                                                      break;
1319:                                                  }
1320:                                              case "serviceRequestCustomerNameHyperLink":
1321:                                                  {
1322:                                                      hl.Text = serviceRequest.CustomerName;
1323:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + HttpUtility.UrlEncode(serviceRequest.CustomerName);
1324:                                                      break;
1325:                                                  }
1326:                                              case "impuHuSbrHyperLink":
1327:                                                  {
1328:                                                      hl.Text = huSbr.IMPU;
1329:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + HttpUtility.UrlEncode(huSbr.IMPU);
1330:                                                      break;
1331:                                                  }
1332:                                              case "impuOwsbrHyperLink":
1333:                                                  {
1334:                                                      hl.Text = owsbr.IMPU;
1335:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + HttpUtility.UrlEncode(owsbr.IMPU);
1336:                                                      break;
1337:                                                  }
1338:                                              case "seruattrUsrnumHyperLink":
1339:                                                  {
1340:                                                      hl.Text = seruattr.USRNUM;
1341:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + HttpUtility.UrlEncode(seruattr.USRNUM);
1342:                                                      break;
1343:                                                  }
1344:                                              case "accessPositionHyperLink":
1345:                                                  {
1346:                                                      hl.Text = access.Position;
1347:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + access.Position;
1348:   
1349:                                                      break;
1350:                                                  }
1351:                                              case "ontSerialHyperLink":
1352:                                                  {
1353:                                                      hl.Text = ont.Serial;
1354:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + ont.Serial;
1355:                                                      break;
1356:                                                  }
1357:                                              case "reportAccessServiceRequestAccessNameHyperLink":
1358:                                                  {
1359:                                                      hl.Text = reportAccessServiceRequest.Access.Name;
1360:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + reportAccessServiceRequest.Access.Name;
1361:                                                      break;
1362:                                                  }
1363:                                              case "nddOntNameHyperLink":
1364:                                                  {
1365:                                                      hl.Text = nddOnt.Access.Name;
1366:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + nddOnt.Access.Name;
1367:                                                      break;
1368:                                                  }
1369:                                              case "nddOntPonNameHyperLink":
1370:                                                  {
1371:                                                      hl.Text = nddOnt.Pon.Name;
1372:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + nddOnt.Pon.Name;
1373:                                                      break;
1374:                                                  }
1375:                                              case "nddOntPositionHyperLink":
1376:                                                  {
1377:                                                      hl.Text = nddOnt.Position;
1378:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + nddOnt.Position;
1379:                                                      break;
1380:                                                  }
1381:                                              case "nddOntIpHyperLink":
1382:                                                  {
1383:                                                      hl.Text = nddOnt.Ip;
1384:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + nddOnt.Ip;
1385:                                                      break;
1386:                                                  }
1387:                                              case "serviceRequestServiceServiceHyperLink":
1388:                                                  {
1389:                                                      s = Ia.Ngn.Cl.Model.Business.Service.ServiceName(serviceRequestService.Service, serviceRequestService.ServiceType);
1390:   
1391:                                                      hl.Text = s;
1392:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + s;
1393:                                                      break;
1394:                                                  }
1395:                                              case "serviceRequestServiceAccessNameHyperLink":
1396:                                                  {
1397:                                                      if (serviceRequestService.Access != null)
1398:                                                      {
1399:                                                          hl.Text = serviceRequestService.Access.Name;
1400:                                                          hl.NavigateUrl = "~/maintenance/find.aspx?input=" + serviceRequestService.Access.Name;
1401:                                                      }
1402:                                                      break;
1403:                                                  }
1404:                                              case "serviceRequestNumberHyperLink":
1405:                                                  {
1406:                                                      hl.Text = serviceRequest.Number.ToString();
1407:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + serviceRequest.Number.ToString();
1408:                                                      break;
1409:                                                  }
1410:                                              case "serviceRequestCustomerIdHyperLink":
1411:                                                  {
1412:                                                      hl.Text = serviceRequest.CustomerId.ToString();
1413:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + serviceRequest.CustomerId.ToString() + "&inputType=" + Ia.Ngn.Cl.Model.Business.ServiceRequest.ServiceRequestCustomerIdInputTypeString;
1414:                                                      break;
1415:                                                  }
1416:                                              case "serviceRequestHistoryNumberHyperLink":
1417:                                                  {
1418:                                                      hl.Text = serviceRequestHistory.Number.ToString();
1419:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + serviceRequestHistory.Number.ToString();
1420:                                                      break;
1421:                                                  }
1422:                                              case "accessOdfHyperLink":
1423:                                                  {
1424:                                                      hl.Text = access.Odf;
1425:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + access.Odf;
1426:                                                      break;
1427:                                                  }
1428:                                              case "accessNameHyperLink":
1429:                                                  {
1430:                                                      hl.Text = access.Name;
1431:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + access.Name;
1432:                                                      break;
1433:                                                  }
1434:                                              case "accessBlockHyperLink":
1435:                                                  {
1436:                                                      int i;
1437:                                                      string areaSymbol;
1438:   
1439:                                                      if (int.TryParse(access.Block, out i))
1440:                                                      {
1441:                                                          hl.Text = access.Block;
1442:                                                          areaSymbol = (from kna in Ia.Ngn.Cl.Model.Data.Service.KuwaitNgnAreaList where kna.Id == access.AreaId select kna.Symbol).SingleOrDefault();
1443:   
1444:                                                          if (!string.IsNullOrEmpty(areaSymbol))
1445:                                                          {
1446:                                                              hl.NavigateUrl = "~/maintenance/find.aspx?input=" + areaSymbol + "," + access.Block;
1447:                                                          }
1448:                                                          else
1449:                                                          {
1450:   
1451:                                                          }
1452:                                                      }
1453:                                                      else
1454:                                                      {
1455:   
1456:                                                      }
1457:   
1458:                                                      break;
1459:                                                  }
1460:   
1461:                                              case "service2ServiceHyperLink":
1462:                                                  {
1463:                                                      s = Ia.Ngn.Cl.Model.Business.Service.ServiceName(service2.Service, service2.ServiceType);
1464:   
1465:                                                      hl.Text = s;
1466:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + s;
1467:                                                      break;
1468:                                                  }
1469:                                              case "service2AccessNameHyperLink":
1470:                                                  {
1471:                                                      if (service2.AccessName != null)
1472:                                                      {
1473:                                                          hl.Text = service2.AccessName;
1474:                                                          hl.NavigateUrl = "~/maintenance/find.aspx?input=" + service2.AccessName;
1475:                                                      }
1476:                                                      break;
1477:                                                  }
1478:   
1479:                                              case "newOntEventAccessNameHyperLink":
1480:                                                  {
1481:                                                      if (newOntEvent.AccessName != null)
1482:                                                      {
1483:                                                          hl.Text = newOntEvent.AccessName;
1484:                                                          hl.NavigateUrl = "~/maintenance/find.aspx?input=" + newOntEvent.AccessName;
1485:                                                      }
1486:                                                      break;
1487:                                                  }
1488:                                              case "serviceExemptionServiceLabel":
1489:                                                  {
1490:                                                      s = Ia.Ngn.Cl.Model.Business.Service.ServiceName(serviceExemption.Service, serviceExemption.ServiceType);
1491:   
1492:                                                      hl.Text = s;
1493:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + s;
1494:                                                      break;
1495:                                                  }
1496:                                              case "gwIdAgcfGatewayRecordHyperLink":
1497:                                                  {
1498:                                                      hl.Text = agcfGatewayRecord.GwId.ToString();
1499:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + agcfGatewayRecord.GwId;
1500:                                                      break;
1501:                                                  }
1502:                                              case "ip1AgcfGatewayRecordHyperLink":
1503:                                                  {
1504:                                                      hl.Text = agcfGatewayRecord.IP1;
1505:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + agcfGatewayRecord.IP1;
1506:                                                      break;
1507:                                                  }
1508:                                              case "ip2AgcfGatewayRecordHyperLink":
1509:                                                  {
1510:                                                      hl.Text = agcfGatewayRecord.IP2;
1511:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + agcfGatewayRecord.IP2;
1512:                                                      break;
1513:                                                  }
1514:                                              case "gwIdAgcfEndpointHyperLink":
1515:                                                  {
1516:                                                      hl.Text = agcfEndpoint.GwId.ToString();
1517:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + agcfEndpoint.GwId.ToString();
1518:                                                      break;
1519:                                                  }
1520:                                              case "subPartyDisplayNameHyperLink":
1521:                                                  {
1522:                                                      hl.Text = subParty.DisplayName;
1523:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + subParty.DisplayName;
1524:                                                      break;
1525:                                                  }
1526:                                              case "ontServiceVoipIpHyperLink":
1527:                                                  {
1528:                                                      hl.Text = ontServiceVoip.Ip.ToString();
1529:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + ontServiceVoip.Ip.ToString();
1530:                                                      break;
1531:                                                  }
1532:                                              case "reportHistoryHyperLink":
1533:                                                  {
1534:                                                      //hl.Text = "<img src=" + Ia.Cl.Model.Default.AbsoluteUrl(page) + "/image/legend/history.png class=icon alt=History width=19 height=19 />";
1535:                                                      hl.NavigateUrl = "~/maintenance/report/history.aspx?reportId=" + report.Id;
1536:                                                      break;
1537:                                                  }
1538:                                              case "reportHistoryServiceHyperLink":
1539:                                                  {
1540:                                                      s = Ia.Ngn.Cl.Model.Business.Service.ServiceName(reportHistory.Report.Service, reportHistory.Report.ServiceType);
1541:   
1542:                                                      hl.Text = s;
1543:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + s;
1544:                                                      break;
1545:                                                  }
1546:                                              case "serviceServiceAccessNameHyperLink":
1547:                                                  {
1548:                                                      if (serviceAccessName.Service != null)
1549:                                                      {
1550:                                                          hl.Text = serviceAccessName.Service;
1551:                                                          hl.NavigateUrl = "~/maintenance/find.aspx?input=" + serviceAccessName.Service;
1552:                                                      }
1553:                                                      break;
1554:                                                  }
1555:                                              case "accessNameServiceAccessNameHyperLink":
1556:                                                  {
1557:                                                      if (serviceAccessName.AccessName != null)
1558:                                                      {
1559:                                                          hl.Text = serviceAccessName.AccessName;
1560:                                                          hl.NavigateUrl = "~/maintenance/find.aspx?input=" + serviceAccessName.AccessName;
1561:                                                      }
1562:                                                      break;
1563:                                                  }
1564:                                              case "serviceRequestOntDetailServiceHyperLink":
1565:                                                  {
1566:                                                      s = Ia.Ngn.Cl.Model.Business.Service.ServiceName(serviceRequestOntDetail.Service, serviceRequestOntDetail.ServiceType);
1567:   
1568:                                                      hl.Text = s;
1569:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + s;
1570:                                                      break;
1571:                                                  }
1572:                                              default: break;
1573:                                          }
1574:                                      }
1575:                                      else if (control.Controls[0].GetType().ToString() == "System.Web.UI.WebControls.TextBox")
1576:                                      {
1577:                                          TextBox tb = (TextBox)control.Controls[0];
1578:   
1579:                                          switch (tb.ID)
1580:                                          {
1581:                                              case "staffEmploymentIdTextBox": tb.Text = staff.EmploymentId.ToString(); break;
1582:                                              case "staffFirstNameTextBox": tb.Text = staff.FirstName; break;
1583:                                              case "staffMiddleNameTextBox": tb.Text = staff.MiddleName; break;
1584:                                              case "staffLastNameTextBox": tb.Text = staff.LastName; break;
1585:                                              case "staffIpPbxExtensionTextBox": tb.Text = staff.IpPbxExtension; break;
1586:   
1587:                                              case "contactFirstNameTextBox": tb.Text = contact.FirstName; break;
1588:                                              case "contactMiddleNameTextBox": tb.Text = contact.MiddleName; break;
1589:                                              case "contactLastNameTextBox": tb.Text = contact.LastName; break;
1590:                                              case "contactCompanyTextBox": tb.Text = contact.Company; break;
1591:                                              case "contactEmailTextBox": tb.Text = contact.Email; break;
1592:                                              case "contactPhoneTextBox": tb.Text = contact.Phone; break;
1593:                                              case "contactAddressTextBox": tb.Text = contact.Address; break;
1594:                                              case "contactUrlTextBox": tb.Text = contact.Url; break;
1595:                                              case "contactNoteTextBox": tb.Text = contact.Note; break;
1596:   
1597:                                              case "userNameTextBox": tb.Text = membershipUser.UserName; break;
1598:                                              case "userEmailTextBox": tb.Text = membershipUser.Email; break;
1599:                                              case "accessBlockTextBox": tb.Text = access.Block.ToString(); break;
1600:                                              case "accessStreetTextBox": tb.Text = access.Street; break;
1601:                                              case "accessPremisesOldTextBox": tb.Text = access.PremisesOld; break;
1602:                                              case "accessPremisesNewTextBox": tb.Text = access.PremisesNew; break;
1603:                                              case "accessPaciTextBox": tb.Text = access.Paci; break;
1604:                                              case "accessNoteTextBox": tb.Text = access.Note; break;
1605:   
1606:                                              case "serviceExemptionNoteTextBox": tb.Text = serviceExemption.Note; break;
1607:   
1608:                                              default: break;
1609:                                          }
1610:                                      }
1611:                                      else if (control.Controls[0].GetType().ToString() == "System.Web.UI.WebControls.DropDownList")
1612:                                      {
1613:                                          DropDownList ddl = (DropDownList)control.Controls[0];
1614:   
1615:                                          switch (ddl.ID)
1616:                                          {
1617:                                              case "staffAdministrativeFrameworkIdDropDownList":
1618:                                                  {
1619:                                                      ddl.DataSource = Ia.Ngn.Cl.Model.Data.Administration.FrameworkList;
1620:                                                      ddl.DataValueField = "Id";
1621:                                                      ddl.DataTextField = "FullyQualifiedArabicName";
1622:                                                      ddl.DataBind();
1623:   
1624:                                                      ddl.SelectedIndex = ddl.Items.IndexOf(ddl.Items.FindByValue(staff.AdministrativeFrameworkId.ToString()));
1625:                                                      break;
1626:                                                  }
1627:   
1628:                                              case "staffIdentityUserIdDropDownList":
1629:                                                  {
1630:                                                      ddl.Items.Clear();
1631:   
1632:                                                      userList = Ia.Cl.Model.Identity.UserList;
1633:   
1634:                                                      ddl.DataSource = userList;
1635:                                                      ddl.DataValueField = "ProviderUserKey";
1636:                                                      ddl.DataTextField = "UserName";
1637:                                                      ddl.DataBind();
1638:   
1639:                                                      ddl.Items.Insert(0, new ListItem("Empty Guid", Guid.Empty.ToString()));
1640:                                                      ddl.SelectedIndex = ddl.Items.IndexOf(ddl.Items.FindByValue(staff.UserId.ToString()));
1641:                                                      break;
1642:                                                  }
1643:   
1644:                                              default: break;
1645:                                          }
1646:                                      }
1647:                                      else if (control.Controls[0].GetType().ToString() == "System.Web.UI.WebControls.CheckBox")
1648:                                      {
1649:                                          CheckBox cb = (CheckBox)control.Controls[0];
1650:   
1651:                                          switch (cb.ID)
1652:                                          {
1653:                                              case "staffIsHeadCheckBox": cb.Checked = staff.IsHead; break;
1654:                                              case "contactApprovedCheckBox": cb.Checked = contact.IsApproved; break;
1655:                                              default: break;
1656:                                          }
1657:                                      }
1658:                                      else if (control.Controls[0].GetType().ToString() == "System.Web.UI.WebControls.Image")
1659:                                      {
1660:                                          Image im = (Image)control.Controls[0];
1661:   
1662:                                          switch (im.ID)
1663:                                          {
1664:                                              case "deleteImage": break;
1665:                                              case "historyImage": break;
1666:                                              case "nddOntPonOltOdfAccessVendorIconImage":
1667:                                                  {
1668:                                                      vendor = (from o in Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.OntList where o.Id == nddOnt.Id select o.Pon.PonGroup.Olt.Odf.Vendor).SingleOrDefault();
1669:                                                      im.ImageUrl = vendor.ImageUrl;
1670:                                                      im.ToolTip = vendor.Name;
1671:                                                      break;
1672:                                                  }
1673:                                              case "nddOntPonOltOdfRouterSwitchVendorIconImage":
1674:                                                  {
1675:                                                      vendor = (from o in Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.OntList where o.Id == nddOnt.Id select o.Pon.PonGroup.Olt.Odf.Router.Vendor).SingleOrDefault();
1676:                                                      im.ImageUrl = vendor.ImageUrl;
1677:                                                      im.ToolTip = vendor.Name;
1678:                                                      break;
1679:                                                  }
1680:                                              /*
1681:                                          case "ontAccessOntPonOltOdfVendorIconImage":
1682:                                              {
1683:                                                  vendor = (from q in Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.OntList where q.Id == ont.Id select q.Pon.PonGroup.Olt.Odf.Vendor).SingleOrDefault();
1684:                                                  im.ImageUrl = vendor.ImageUrl;
1685:                                                  im.ToolTip = vendor.Name;
1686:                                                  break;
1687:                                              }
1688:                                              */
1689:                                              case "accessOntPonOltOdfVendorIconImage":
1690:                                                  {
1691:                                                      vendor = (from o in Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.OntList where o.Access.Id == access.Id select o.Pon.PonGroup.Olt.Odf.Vendor).SingleOrDefault();
1692:                                                      im.ImageUrl = vendor.ImageUrl;
1693:                                                      im.ToolTip = vendor.Name;
1694:                                                      break;
1695:                                                  }
1696:                                              default: break;
1697:                                          }
1698:                                      }
1699:                                      else
1700:                                      {
1701:   
1702:                                      }
1703:                                  }
1704:                              }
1705:                              catch (Exception)
1706:                              {
1707:                              }
1708:                          }
1709:                      }
1710:                      else if (e.Row.RowType == DataControlRowType.Footer)
1711:                      {
1712:                      }
1713:                      else
1714:                      {
1715:                      }
1716:                  }
1717:                  else
1718:                  {
1719:                  }
1720:              }
1721:              else
1722:              {
1723:              }
1724:          }
1725:   
1726:          ////////////////////////////////////////////////////////////////////////////
1727:          ////////////////////////////////////////////////////////////////////////////
1728:   
1729:          /// <summary>
1730:          ///
1731:          /// </summary>
1732:          public static void DropDownList_DataBound(System.Web.UI.Page page, object sender, EventArgs e, Ia.Ngn.Cl.Model.Staff staff)
1733:          {
1734:              string kuwaitNgnAreaListString;
1735:              DropDownList ddl;
1736:              List<Ia.Ngn.Cl.Model.Business.Service.KuwaitNgnArea> kuwaitNgnAreaList;
1737:   
1738:              ddl = (DropDownList)sender;
1739:   
1740:              foreach (ListItem listItem in ddl.Items)
1741:              {
1742:                  kuwaitNgnAreaList = (from k in Ia.Ngn.Cl.Model.Data.Service.KuwaitNgnAreaList where k.SiteList != null && k.SiteList.Any(u => u.Id == int.Parse(listItem.Value)) select k).ToList();
1743:   
1744:                  if (kuwaitNgnAreaList != null && kuwaitNgnAreaList.Count > 0)
1745:                  {
1746:                      kuwaitNgnAreaListString = string.Join(", ", kuwaitNgnAreaList.Select(n => n.ArabicName).ToArray());
1747:                  }
1748:                  else kuwaitNgnAreaListString = null;
1749:   
1750:                  listItem.Text = kuwaitNgnAreaListString;
1751:              }
1752:          }
1753:   
1754:          ////////////////////////////////////////////////////////////////////////////
1755:   
1756:          /// <summary>
1757:          ///
1758:          /// </summary>
1759:          public static void DropDownList_DataBound(System.Web.UI.Page page, object sender, EventArgs e)
1760:          {
1761:              DropDownList_DataBound(page, sender, e, null);
1762:          }
1763:   
1764:          ////////////////////////////////////////////////////////////////////////////
1765:          ////////////////////////////////////////////////////////////////////////////
1766:   
1767:          /// <summary>
1768:          ///
1769:          /// </summary>
1770:          public static void DataList_ItemDataBound(System.Web.UI.Page page, object sender, DataListItemEventArgs e)
1771:          {
1772:              bool senderKnown;
1773:              string s, senderId;
1774:              DataList dataList;
1775:   
1776:              senderKnown = true;
1777:              dataList = (DataList)sender;
1778:              senderId = dataList.ID;
1779:   
1780:              string accessName;
1781:   
1782:              accessName = null;
1783:   
1784:              switch (senderId)
1785:              {
1786:                  case "accessNameDataList":
1787:                      {
1788:                          //access = (e.Item.DataItem as Ia.Ngn.Cl.Model.Access);
1789:                          accessName = (e.Item.DataItem as string);
1790:                          break;
1791:                      }
1792:                  default:
1793:                      senderKnown = false;
1794:                      break;
1795:              }
1796:   
1797:              senderKnown = true;
1798:   
1799:              if (senderKnown)
1800:              {
1801:                  if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
1802:                  {
1803:                      //CheckBox chk = e.Item.FindControl("AApBlue") as CheckBox;
1804:                      //Label lbl = e.Item.FindControl("Label1") as Label;
1805:   
1806:                      //chk.Checked = (lbl.Text == "Y") ? true : false;
1807:   
1808:                      HyperLink hl = e.Item.FindControl("accessNameHyperLink") as HyperLink;
1809:   
1810:                      hl.Text = accessName;
1811:                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + accessName;
1812:                  }
1813:   
1814:                  //foreach (DataListItem dataListItem in dataList.Items)
1815:                  // {
1816:                  foreach (Control control in dataList.Controls) // dataListItem.Controls)
1817:                  {
1818:                      try
1819:                      {
1820:                          if (control is Label)
1821:                          {
1822:                              // CheckBox cb = (CheckBox)control.Controls[0];
1823:                              Label l = (Label)control;
1824:   
1825:                              switch (l.ID)
1826:                              {
1827:                                  /*
1828:                                  case "accessAreaLabel": l.Text = (from kna in Ia.Ngn.Cl.Model.Data.Service.KuwaitNgnAreaList where kna.Id == accessName.AreaId select kna.ArabicName).SingleOrDefault(); break;
1829:                                  case "accessOltLabel": l.Text = (from o in Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.OltList where o.Id == accessName.Olt select o.AmsName).SingleOrDefault(); break;
1830:                                  case "accessBlockLabel": l.Text = accessName.Block.ToString(); break;
1831:                                  case "accessStreetLabel": l.Text = accessName.Street; break;
1832:                                  case "accessPremisesOldLabel": l.Text = accessName.PremisesOld; break;
1833:                                  case "accessPremisesNewLabel": l.Text = accessName.PremisesNew; break;
1834:                                  case "accessPaciLabel": l.Text = accessName.Paci; break;
1835:                                  case "accessNoteLabel": l.Text = accessName.Note; break;
1836:                                  case "accessStaffNameLabel": l.Text = (from _s in Ia.Ngn.Cl.Model.Data.Staff.List where _s.UserId == accessName.UserId select _s.FirstName).SingleOrDefault(); break;
1837:                                  */    /*
1838:                                  case "accessOntFamilyTypeCapacityLabel":
1839:                                      {
1840:                                          // temp: later quickly find vendor from accessId
1841:                                          try
1842:                                          {
1843:                                              if (access.Onts != null && access.Onts.Count > 0)
1844:                                              {
1845:                                                  l.Text = Ia.Ngn.Cl.Model.Data.Nokia.Ont.FamilyTypeFromId(access.Onts.FirstOrDefault().FamilyTypeId);
1846:  
1847:                                                  l.Text += " (" + Ia.Ngn.Cl.Model.Business.Nokia.Ams.PossibleNumberOfTdForOntFamilyType(access.Onts.FirstOrDefault().FamilyTypeId) + ")";
1848:                                              }
1849:                                              else l.Text = "";
1850:                                          }
1851:                                          catch (Exception)// ex)
1852:                                          {
1853:                                              l.Text = "";
1854:                                          }
1855:  
1856:                                          break;
1857:                                      }
1858:  
1859:                                  case "accessFamilyTypeInAreaBlockLabel": l.Text = (from kna in Ia.Ngn.Cl.Model.Data.Service.KuwaitNgnAreaList where kna.Id == accessFamilyTypeInAreaBlock.AreaId select kna.NameArabicName).SingleOrDefault(); break;
1860:                                  */
1861:                              }
1862:                          }
1863:                          else if (control is HyperLink) // .GetType().ToString() == "System.Web.UI.WebControls.HyperLink")
1864:                          {
1865:                              HyperLink hl = (HyperLink)control;
1866:   
1867:                              switch (hl.ID)
1868:                              {
1869:                                  case "accessNameHyperLink":
1870:                                      {
1871:                                          hl.Text = accessName; //.Name;
1872:                                          hl.NavigateUrl = "~/maintenance/find.aspx?input=" + accessName; //.Name;
1873:                                          break;
1874:                                      }
1875:                                  default:
1876:                                      {
1877:                                          break;
1878:                                      }
1879:                              }
1880:                          }
1881:                          else
1882:                          {
1883:   
1884:                          }
1885:                      }
1886:                      catch (Exception)
1887:                      {
1888:   
1889:                      }
1890:                  }
1891:                  //}
1892:              }
1893:              else
1894:              {
1895:   
1896:              }
1897:          }
1898:   
1899:          ////////////////////////////////////////////////////////////////////////////
1900:          ////////////////////////////////////////////////////////////////////////////
1901:   
1902:          /// <summary>
1903:          ///
1904:          /// </summary>
1905:          public static void FormView_DataBound(System.Web.UI.Page page, object sender, EventArgs e)
1906:          {
1907:          }
1908:   
1909:          ////////////////////////////////////////////////////////////////////////////
1910:          ////////////////////////////////////////////////////////////////////////////
1911:      }
1912:   
1913:      ////////////////////////////////////////////////////////////////////////////
1914:      ////////////////////////////////////////////////////////////////////////////
1915:  }