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

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