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

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

Default 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.ServiceRequestOnt serviceRequestOnt;
 480:              Ia.Ngn.Cl.Model.ServiceRequestOntDetail serviceRequestOntDetail;
 481:              Ia.Ngn.Cl.Model.Ui.Huawei.HuSbr huSbr;
 482:              Ia.Ngn.Cl.Model.Huawei.Owsbr owsbr;
 483:              Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt;
 484:              Ia.Ngn.Cl.Model.Ont ont;
 485:              Ia.Ngn.Cl.Model.OntOntPots ontOntPots;
 486:              Ia.Ngn.Cl.Model.Ui.ServiceRequestService serviceRequestService;
 487:              Ia.Ngn.Cl.Model.ServiceInitialState serviceInitialState;
 488:              Ia.Ngn.Cl.Model.Access access;
 489:              Ia.Ngn.Cl.Model.Ui.Service2 service2;
 490:              Ia.Ngn.Cl.Model.Ui.Nokia.AgcfGatewayRecord agcfGatewayRecord;
 491:              Ia.Ngn.Cl.Model.Ui.Nokia.AgcfEndpoint agcfEndpoint;
 492:              Ia.Ngn.Cl.Model.Ui.Nokia.SubParty subParty;
 493:              Ia.Ngn.Cl.Model.Ui.Nokia.Subscriber subscriber;
 494:              Ia.Ngn.Cl.Model.OntServiceVoip ontServiceVoip;
 495:              Ia.Ngn.Cl.Model.Ui.Huawei.EmsOnt emsOnt;
 496:              Ia.Ngn.Cl.Model.Huawei.EmsOntSipInfo emsOntSipInfo;
 497:              Ia.Ngn.Cl.Model.Huawei.EmsVoipPstnUser emsVoipPstnUser;
 498:              Ia.Ngn.Cl.Model.Staff staff;
 499:              Ia.Ngn.Cl.Model.Contact contact;
 500:              Ia.Ngn.Cl.Model.ServiceExemption serviceExemption;
 501:              Ia.Ngn.Cl.Model.Ui.ReportAccessServiceRequest reportAccessServiceRequest;
 502:              Ia.Ngn.Cl.Model.Business.Service.KuwaitNgnArea kuwaitNgnArea;
 503:              Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor vendor;
 504:              Ia.Ngn.Cl.Model.Ui.Maintenance.AccessFamilyTypeAreaBlock accessFamilyTypeInAreaBlock;
 505:              Ia.Ngn.Cl.Model.Ui.Event newOntEvent;
 506:              Ia.Ngn.Cl.Model.Business.ServiceAccessName serviceAccessName;
 507:              MembershipUser membershipUser;
 508:   
 509:              areaId = 0;
 510:              userId = Guid.Empty;
 511:              senderId = e.Row.Parent.Parent.ID;
 512:   
 513:              if (e.Row.RowType == DataControlRowType.Header || e.Row.RowType == DataControlRowType.Footer || e.Row.RowType == DataControlRowType.DataRow)
 514:              {
 515:                  report = null;
 516:                  reportHistory = null;
 517:                  serviceRequest = null;
 518:                  serviceRequestOnt = null;
 519:                  serviceRequestOntDetail = null;
 520:                  huSbr = null;
 521:                  owsbr = null;
 522:                  agcfGatewayRecord = null;
 523:                  agcfEndpoint = null;
 524:                  subParty = null;
 525:                  subscriber = null;
 526:                  nddOnt = null;
 527:                  ont = null;
 528:                  serviceRequestService = null;
 529:                  serviceInitialState = null;
 530:                  access = null;
 531:                  ontOntPots = null;
 532:                  ontServiceVoip = null;
 533:                  emsOnt = null;
 534:                  emsOntSipInfo = null;
 535:                  service2 = null;
 536:                  staff = null;
 537:                  contact = null;
 538:                  serviceExemption = null;
 539:                  membershipUser = null;
 540:                  reportAccessServiceRequest = null;
 541:                  kuwaitNgnArea = null;
 542:                  vendor = null;
 543:                  accessFamilyTypeInAreaBlock = null;
 544:                  newOntEvent = null;
 545:                  serviceAccessName = null;
 546:   
 547:                  senderKnown = true;
 548:   
 549:                  switch (senderId)
 550:                  {
 551:                      case "reportGridView":
 552:                          {
 553:                              report = (e.Row.DataItem as Ia.Ngn.Cl.Model.Report);
 554:                              buttonColumnType = GridViewButtonColumnType.DeleteAndDeleteOffAndDeleteChildOffAndHistoryButtons;
 555:                              break;
 556:                          }
 557:                      case "fieldTnmdSupplierReportGridView":
 558:                          {
 559:                              reportAccessServiceRequest = (e.Row.DataItem as Ia.Ngn.Cl.Model.Ui.ReportAccessServiceRequest);
 560:                              break;
 561:                          }
 562:                      case "insertedRecordGridView":
 563:                          {
 564:                              report = (e.Row.DataItem as Ia.Ngn.Cl.Model.Report);
 565:                              break;
 566:                          }
 567:                      case "reportListHistoryColumnOnlyGridView":
 568:                          {
 569:                              report = (e.Row.DataItem as Ia.Ngn.Cl.Model.Report);
 570:                              buttonColumnType = GridViewButtonColumnType.HistoryButton;
 571:                              break;
 572:                          }
 573:                      case "reportHistoryGridView":
 574:                          {
 575:                              reportHistory = (e.Row.DataItem as Ia.Ngn.Cl.Model.ReportHistory);
 576:                              buttonColumnType = GridViewButtonColumnType.DeleteAndDeleteOffButton;
 577:                              break;
 578:                          }
 579:                      case "serviceRequestGridView":
 580:                          {
 581:                              serviceRequest = (e.Row.DataItem as Ia.Ngn.Cl.Model.ServiceRequest);
 582:                              break;
 583:                          }
 584:                      case "serviceRequestOntGridView":
 585:                          {
 586:                              serviceRequestOnt = (e.Row.DataItem as Ia.Ngn.Cl.Model.ServiceRequestOnt);
 587:                              break;
 588:                          }
 589:                      case "serviceRequestOntDetailGridView":
 590:                          {
 591:                              serviceRequestOntDetail = (e.Row.DataItem as Ia.Ngn.Cl.Model.ServiceRequestOntDetail);
 592:                              break;
 593:                          }
 594:                      case "huSbrGridView":
 595:                          {
 596:                              huSbr = (e.Row.DataItem as Ia.Ngn.Cl.Model.Ui.Huawei.HuSbr);
 597:                              break;
 598:                          }
 599:                      case "owsbrGridView":
 600:                          {
 601:                              owsbr = (e.Row.DataItem as Ia.Ngn.Cl.Model.Huawei.Owsbr);
 602:                              break;
 603:                          }
 604:                      case "agcfGatewayRecordGridView":
 605:                          {
 606:                              agcfGatewayRecord = (e.Row.DataItem as Ia.Ngn.Cl.Model.Ui.Nokia.AgcfGatewayRecord);
 607:                              break;
 608:                          }
 609:                      case "agcfEndpointGridView":
 610:                          {
 611:                              agcfEndpoint = (e.Row.DataItem as Ia.Ngn.Cl.Model.Ui.Nokia.AgcfEndpoint);
 612:                              break;
 613:                          }
 614:                      case "subPartyGridView":
 615:                          {
 616:                              subParty = (e.Row.DataItem as Ia.Ngn.Cl.Model.Ui.Nokia.SubParty);
 617:                              break;
 618:                          }
 619:                      case "subscriberGridView":
 620:                          {
 621:                              subscriber = (e.Row.DataItem as Ia.Ngn.Cl.Model.Ui.Nokia.Subscriber);
 622:                              break;
 623:                          }
 624:                      case "nddOntGridView":
 625:                          {
 626:                              nddOnt = (e.Row.DataItem as Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont);
 627:                              break;
 628:                          }
 629:                      case "ontGridView":
 630:                          {
 631:                              ont = (e.Row.DataItem as Ia.Ngn.Cl.Model.Ont);
 632:                              break;
 633:                          }
 634:                      case "ontOntPotsGridView":
 635:                          {
 636:                              ontOntPots = (e.Row.DataItem as Ia.Ngn.Cl.Model.OntOntPots);
 637:                              break;
 638:                          }
 639:                      case "serviceRequestServiceGridView":
 640:                          {
 641:                              serviceRequestService = (e.Row.DataItem as Ia.Ngn.Cl.Model.Ui.ServiceRequestService);
 642:                              break;
 643:                          }
 644:                      case "serviceInitialStateGridView":
 645:                          {
 646:                              serviceInitialState = (e.Row.DataItem as Ia.Ngn.Cl.Model.ServiceInitialState);
 647:                              break;
 648:                          }
 649:                      case "accessGridView":
 650:                          {
 651:                              access = (e.Row.DataItem as Ia.Ngn.Cl.Model.Access);
 652:                              break;
 653:                          }
 654:                      case "serviceGridView":
 655:                          {
 656:                              service2 = (e.Row.DataItem as Ia.Ngn.Cl.Model.Ui.Service2);
 657:                              break;
 658:                          }
 659:                      case "ontServiceVoipGridView":
 660:                          {
 661:                              ontServiceVoip = (e.Row.DataItem as Ia.Ngn.Cl.Model.OntServiceVoip);
 662:                              break;
 663:                          }
 664:                      case "emsOntGridView":
 665:                          {
 666:                              emsOnt = (e.Row.DataItem as Ia.Ngn.Cl.Model.Ui.Huawei.EmsOnt);
 667:                              break;
 668:                          }
 669:                      case "emsOntSipInfoGridView":
 670:                          {
 671:                              emsOntSipInfo = (e.Row.DataItem as Ia.Ngn.Cl.Model.Huawei.EmsOntSipInfo);
 672:                              break;
 673:                          }
 674:                      case "emsVoipPstnUserGridView":
 675:                          {
 676:                              emsVoipPstnUser = (e.Row.DataItem as Ia.Ngn.Cl.Model.Huawei.EmsVoipPstnUser);
 677:                              break;
 678:                          }
 679:                      case "staffGridView":
 680:                          {
 681:                              staff = (e.Row.DataItem as Ia.Ngn.Cl.Model.Staff);
 682:                              break;
 683:                          }
 684:                      case "contactGridView":
 685:                          {
 686:                              contact = (e.Row.DataItem as Ia.Ngn.Cl.Model.Contact);
 687:                              break;
 688:                          }
 689:                      case "userGridView":
 690:                          {
 691:                              membershipUser = (e.Row.DataItem as MembershipUser);
 692:                              break;
 693:                          }
 694:                      case "accessFamilyTypeInAreaBlockGridView":
 695:                          {
 696:                              accessFamilyTypeInAreaBlock = (e.Row.DataItem as Ia.Ngn.Cl.Model.Ui.Maintenance.AccessFamilyTypeAreaBlock);
 697:                              break;
 698:                          }
 699:                      case "newOntEventGridView":
 700:                          {
 701:                              newOntEvent = (e.Row.DataItem as Ia.Ngn.Cl.Model.Ui.Event);
 702:                              break;
 703:                          }
 704:                      case "staffFrameworkPerformanceGridView":
 705:                          {
 706:                              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;
 707:                              break;
 708:                          }
 709:                      case "kuwaitNgnAreaGridView":
 710:                          {
 711:                              if (e.Row.DataItem != null) kuwaitNgnArea = (Ia.Ngn.Cl.Model.Business.Service.KuwaitNgnArea)e.Row.DataItem;
 712:                              break;
 713:                          }
 714:                      case "serviceExemptionGridView":
 715:                          {
 716:                              serviceExemption = (e.Row.DataItem as Ia.Ngn.Cl.Model.ServiceExemption);
 717:                              break;
 718:                          }
 719:                      case "serviceAccessNameGridView":
 720:                          {
 721:                              serviceAccessName = (e.Row.DataItem as Ia.Ngn.Cl.Model.Business.ServiceAccessName);
 722:                              break;
 723:                          }
 724:                      default:
 725:                          {
 726:                              senderKnown = false;
 727:                              break;
 728:                          }
 729:                  }
 730:   
 731:                  if (senderKnown)
 732:                  {
 733:                      if (e.Row.RowType == DataControlRowType.Header)
 734:                      {
 735:                          if (buttonColumnType == GridViewButtonColumnType.NoButtons)
 736:                          {
 737:                          }
 738:                          else if (buttonColumnType == GridViewButtonColumnType.HistoryButton)
 739:                          {
 740:                              // below: for the header just keep the first column visible
 741:                              e.Row.Cells[0].Visible = true;
 742:                          }
 743:                          else if (buttonColumnType == GridViewButtonColumnType.DeleteAndDeleteOffButton)
 744:                          {
 745:                              // below: for the header just keep one (first) column visible
 746:                              e.Row.Cells[0].Visible = true;
 747:                              e.Row.Cells[1].Visible = false;
 748:                          }
 749:                          else if (buttonColumnType == GridViewButtonColumnType.DeleteAndDeleteOffAndDeleteChildOffAndHistoryButtons)
 750:                          {
 751:                              // below: for the header just keep one (first) column visible
 752:                              e.Row.Cells[0].Visible = true; // first visible
 753:                              e.Row.Cells[1].Visible = false; // second hidden
 754:                              e.Row.Cells[2].Visible = false; // third hidden
 755:                          }
 756:                          else if (buttonColumnType == GridViewButtonColumnType.DeleteAndEditAndCancelAndUpdateButtons)
 757:                          {
 758:                          }
 759:                      }
 760:                      else if (e.Row.RowType == DataControlRowType.DataRow)
 761:                      {
 762:                          if (buttonColumnType == GridViewButtonColumnType.NoButtons)
 763:                          {
 764:                          }
 765:                          else if (buttonColumnType == GridViewButtonColumnType.HistoryButton)
 766:                          {
 767:                          }
 768:                          else if (buttonColumnType == GridViewButtonColumnType.DeleteAndDeleteOffButton)
 769:                          {
 770:                              // below: manage the delete button according to the role of user
 771:                              if (Ia.Ngn.Cl.Model.Business.Authority.StaffCanCreateReadUpdateDeleteReportHistory(Ia.Ngn.Cl.Model.Business.Authority.PersistentStorageFunction.Delete, report, reportHistory, staffMembershipUser))
 772:                              {
 773:                                  if (reportHistory.Report.StatusIsOpen)
 774:                                  {
 775:                                      // below: report status open
 776:                                      e.Row.Cells[0].Visible = true; // delete is visible
 777:                                      e.Row.Cells[1].Visible = false; // delete-off is hidden
 778:                                  }
 779:                                  else
 780:                                  {
 781:                                      // below: report closed, hence can not delete histories
 782:                                      e.Row.Cells[0].Visible = false; // delete is hidden
 783:                                      e.Row.Cells[1].Visible = true; // delete-off is visible
 784:                                  }
 785:                              }
 786:                              else
 787:                              {
 788:                                  e.Row.Cells[0].Visible = false; // delete is hidden
 789:                                  e.Row.Cells[1].Visible = true; // delete-off is visible
 790:                              }
 791:                          }
 792:                          else if (buttonColumnType == GridViewButtonColumnType.DeleteAndDeleteOffAndDeleteChildOffAndHistoryButtons)
 793:                          {
 794:                              // below: manage the delete button according to the role of user
 795:                              if (Ia.Ngn.Cl.Model.Business.Authority.StaffCanCreateReadUpdateDeleteReport(Ia.Ngn.Cl.Model.Business.Authority.PersistentStorageFunction.Delete, report, staffMembershipUser))
 796:                              {
 797:                                  if (report.StatusIsOpen)
 798:                                  {
 799:                                      if (report.ReportHistories != null && report.ReportHistories.Count > 0)
 800:                                      {
 801:                                          // below: has children
 802:                                          e.Row.Cells[0].Visible = false; // delete is hidden
 803:                                          e.Row.Cells[1].Visible = false; // delete-off is hidden
 804:                                          e.Row.Cells[2].Visible = true;  // delete-child-off is visible
 805:                                      }
 806:                                      else
 807:                                      {
 808:                                          // below: no children
 809:                                          e.Row.Cells[0].Visible = true; // delete is visible
 810:                                          e.Row.Cells[1].Visible = false; // delete-off is hidden
 811:                                          e.Row.Cells[2].Visible = false; // delete-child-off is hidden
 812:                                      }
 813:                                  }
 814:                                  else
 815:                                  {
 816:                                      // below: report is closed, hence can not delete histories
 817:                                      e.Row.Cells[0].Visible = false; // delete is hidden
 818:                                      e.Row.Cells[1].Visible = true; // delete-off is visible
 819:                                      e.Row.Cells[2].Visible = false;  // delete-child-off is hidden
 820:                                  }
 821:                              }
 822:                              else
 823:                              {
 824:                                  e.Row.Cells[0].Visible = false; // delete is hidden
 825:                                  e.Row.Cells[1].Visible = true; // delete-off is visible
 826:                                  e.Row.Cells[2].Visible = false; // delete-child-off is hidden
 827:                              }
 828:                          }
 829:                          else if (buttonColumnType == GridViewButtonColumnType.DeleteAndEditAndCancelAndUpdateButtons)
 830:                          {
 831:                          }
 832:   
 833:   
 834:                          if (report != null)
 835:                          {
 836:                              if (staffMembershipUser != null)
 837:                              {
 838:                                  if (Ia.Ngn.Cl.Model.Data.Report.ReportResponsibilityByStaffGuidListDictionary.ContainsKey(staffMembershipUser.UserId))
 839:                                  {
 840:                                      if (Ia.Ngn.Cl.Model.Data.Report.ReportResponsibilityByStaffGuidListDictionary[staffMembershipUser.UserId].Contains(report.Id))
 841:                                      {
 842:                                          e.Row.CssClass = "selected-row-style";
 843:                                      }
 844:                                      else { }
 845:                                  }
 846:                                  else { }
 847:                              }
 848:                              else { }
 849:                          }
 850:                          else { }
 851:   
 852:   
 853:                          foreach (Control control in e.Row.Controls)
 854:                          {
 855:                              try
 856:                              {
 857:                                  if (control.Controls.Count > 0)
 858:                                  {
 859:                                      if (control.Controls[0].GetType().ToString() == "System.Web.UI.WebControls.Label")
 860:                                      {
 861:                                          Label l = (Label)control.Controls[0];
 862:   
 863:                                          switch (l.ID)
 864:                                          {
 865:                                              case "reportServiceLabel":
 866:                                                  {
 867:                                                      s = Ia.Ngn.Cl.Model.Business.Service.ServiceName(report.Service, report.ServiceType);
 868:                                                      l.Text = s;
 869:                                                      break;
 870:                                                  }
 871:                                              case "reportStatusLabel": l.Text = Ia.Ngn.Cl.Model.Data.Report.StatusColoredDictionary[report.Status].ToString(); break;
 872:                                              case "reportSeverityLabel": l.Text = Ia.Ngn.Cl.Model.Data.Report.SeverityColoredDictionary[report.Severity].ToString(); break;
 873:                                              case "reportCategoryLabel": l.Text = Ia.Ngn.Cl.Model.Data.Report.CategoryDictionary[report.Category].ToString(); break;
 874:                                              case "reportAreaLabel": l.Text = Ia.Ngn.Cl.Model.Data.Report.CategoryAreaColoredDictionary[report.Area].ToString(); break;
 875:                                              case "reportPriorityLabel": l.Text = Ia.Ngn.Cl.Model.Data.Report.PriorityColoredDictionary[report.Priority].ToString(); break;
 876:                                              case "reportDetailLabel": l.Text = Ia.Cl.Model.Html.Decode(report.Detail); break;
 877:                                              case "reportLastHistoricResolutionLabel": l.Text = (report.LastReportHistory != null) ? Ia.Ngn.Cl.Model.Data.Report.ResolutionEnglishAndArabicColoredDictionary[report.LastReportHistory.Resolution].ToString() : ""; break;
 878:   
 879:                                              case "reportStatusLastHistoricResolutionLabel":
 880:                                                  {
 881:                                                      s = Ia.Ngn.Cl.Model.Data.Report.StatusColoredDictionary[report.Status].ToString();
 882:   
 883:                                                      if (report.LastReportHistory != null) s += "/" + Ia.Ngn.Cl.Model.Data.Report.ResolutionEnglishAndArabicColoredDictionary[report.LastReportHistory.Resolution].ToString();
 884:   
 885:                                                      l.Text = s;
 886:   
 887:                                                      break;
 888:                                                  }
 889:   
 890:                                              case "reportLastHistoricalIndicationActionResolutionLabel":
 891:                                                  {
 892:                                                      if (report.LastReportHistory != null)
 893:                                                      {
 894:                                                          s = Ia.Ngn.Cl.Model.Data.Report.IndicationColoredDictionary[report.LastReportHistory.Indication].ToString()
 895:                                                              + "/" + Ia.Ngn.Cl.Model.Data.Report.ActionColoredDictionary[report.LastReportHistory.Action].ToString()
 896:                                                              + "/" + Ia.Ngn.Cl.Model.Data.Report.ResolutionColoredDictionary[report.LastReportHistory.Resolution].ToString();
 897:                                                      }
 898:                                                      else s = string.Empty;
 899:   
 900:                                                      l.Text = s;
 901:   
 902:                                                      break;
 903:                                                  }
 904:   
 905:                                              case "reportAccessServiceRequestLastHistoricResolutionLabel": l.Text = (reportAccessServiceRequest.Report.LastReportHistory != null) ? Ia.Ngn.Cl.Model.Data.Report.ResolutionEnglishAndArabicColoredDictionary[reportAccessServiceRequest.Report.LastReportHistory.Resolution].ToString() : ""; break;
 906:                                              case "reportAccessServiceRequestServiceFlatTermIdLabel": l.Text = "?"; break;
 907:                                              case "reportAccessServiceRequestLastHistoricActionLabel": l.Text = (reportAccessServiceRequest.Report.LastReportHistory != null) ? Ia.Ngn.Cl.Model.Data.Report.ActionColoredDictionary[reportAccessServiceRequest.Report.LastReportHistory.Action].ToString() : ""; break;
 908:                                              case "reportAccessServiceRequestServiceTypeLabel": l.Text = reportAccessServiceRequest.Report.ServiceType.ToString(); break;
 909:                                              case "reportAccessServiceRequestContactLabel": l.Text = Ia.Cl.Model.Html.Decode(reportAccessServiceRequest.Report.Contact); break;
 910:                                              case "reportAccessServiceRequestAddressLabel": l.Text = Ia.Cl.Model.Html.Decode(reportAccessServiceRequest.Access.Address); break;
 911:                                              case "reportAccessServiceRequestStaffFrameworkLabel":
 912:                                                  {
 913:                                                      if (reportAccessServiceRequest.Report.LastReportHistory != null)
 914:                                                      {
 915:                                                          if (Ia.Ngn.Cl.Model.Business.Administration.IsFrameworkGuid(reportAccessServiceRequest.Report.LastReportHistory.UserId))
 916:                                                          {
 917:                                                              l.Text = (from f in Ia.Ngn.Cl.Model.Data.Administration.FrameworkList where f.Guid == reportAccessServiceRequest.Report.LastReportHistory.UserId select f.ArabicName).SingleOrDefault();
 918:                                                          }
 919:                                                          else l.Text = (from _s in Ia.Ngn.Cl.Model.Data.Staff.List where _s.UserId == reportAccessServiceRequest.Report.LastReportHistory.UserId select _s.FirstAndMiddleName).SingleOrDefault();
 920:                                                      }
 921:                                                      else
 922:                                                      {
 923:                                                          l.Text = "";
 924:                                                      }
 925:   
 926:                                                      break;
 927:                                                  }
 928:   
 929:                                              case "reportLastHistoricEstimateLabel": l.Text = (report.LastReportHistory != null) ? l.Text = Ia.Ngn.Cl.Model.Data.Report.EstimateColoredDictionary[report.LastReportHistory.Estimate].ToString() : ""; break;
 930:                                              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;
 931:                                              case "reportLastReportAndHistoricStaffFrameworkLabel":
 932:                                                  {
 933:                                                      if (report.LastReportHistory != null)
 934:                                                      {
 935:                                                          if (Ia.Ngn.Cl.Model.Business.Administration.IsFrameworkGuid(report.LastReportHistory.UserId))
 936:                                                          {
 937:                                                              l.Text = (from f in Ia.Ngn.Cl.Model.Data.Administration.FrameworkList where f.Guid == report.LastReportHistory.UserId select f.ArabicName).SingleOrDefault();
 938:                                                          }
 939:                                                          else l.Text = (from _s in Ia.Ngn.Cl.Model.Data.Staff.List where _s.UserId == report.LastReportHistory.UserId select _s.FirstAndMiddleName).SingleOrDefault();
 940:                                                      }
 941:                                                      else
 942:                                                      {
 943:                                                          if (Ia.Ngn.Cl.Model.Business.Administration.IsFrameworkGuid(report.UserId))
 944:                                                          {
 945:                                                              l.Text = (from f in Ia.Ngn.Cl.Model.Data.Administration.FrameworkList where f.Guid == report.UserId select f.ArabicName).SingleOrDefault();
 946:                                                          }
 947:                                                          else l.Text = (from _s in Ia.Ngn.Cl.Model.Data.Staff.List where _s.UserId == report.UserId select _s.FirstAndMiddleName).SingleOrDefault();
 948:                                                      }
 949:   
 950:                                                      break;
 951:                                                  }
 952:                                              case "reportContactLabel": l.Text = Ia.Cl.Model.Html.Decode(report.Contact); break;
 953:                                              case "reportNoteLabel": l.Text = Ia.Cl.Model.Html.Decode(report.Note); break;
 954:                                              case "reportHistoryIndicationLabel": l.Text = Ia.Ngn.Cl.Model.Data.Report.IndicationColoredDictionary[reportHistory.Indication].ToString(); break;
 955:                                              case "reportHistoryAreaLabel":
 956:                                                  {
 957:                                                      if (Ia.Ngn.Cl.Model.Data.Report.CategoryAreaColoredDictionary.ContainsKey(reportHistory.Area))
 958:                                                      {
 959:                                                          l.Text = Ia.Ngn.Cl.Model.Data.Report.CategoryAreaColoredDictionary[reportHistory.Area].ToString();
 960:                                                      }
 961:                                                      else l.Text = "Error: Area '" + reportHistory.Area + "' not found. ";
 962:   
 963:                                                      break;
 964:                                                  };
 965:                                              case "reportHistoryActionLabel": l.Text = Ia.Ngn.Cl.Model.Data.Report.ActionColoredDictionary[reportHistory.Action].ToString(); break;
 966:                                              case "reportHistoryResolutionLabel": l.Text = Ia.Ngn.Cl.Model.Data.Report.ResolutionEnglishAndArabicColoredDictionary[reportHistory.Resolution].ToString(); break;
 967:                                              case "reportHistoryEstimateLabel": l.Text = Ia.Ngn.Cl.Model.Data.Report.EstimateColoredDictionary[reportHistory.Estimate].ToString(); break;
 968:                                              case "reportHistoryDetailLabel": l.Text = Ia.Cl.Model.Html.Decode(reportHistory.Detail); break;
 969:                                              case "reportHistoryNoteLabel": l.Text = Ia.Cl.Model.Html.Decode(reportHistory.Note); break;
 970:                                              case "reportHistoryStaffFrameworkLabel":
 971:                                                  {
 972:                                                      if (Ia.Ngn.Cl.Model.Business.Administration.IsFrameworkGuid(reportHistory.UserId))
 973:                                                      {
 974:                                                          l.Text = (from f in Ia.Ngn.Cl.Model.Data.Administration.FrameworkList where f.Guid == reportHistory.UserId select f.ArabicName).SingleOrDefault();
 975:                                                      }
 976:                                                      else l.Text = (from _s in Ia.Ngn.Cl.Model.Data.Staff.List where _s.UserId == reportHistory.UserId select _s.FirstAndMiddleName).SingleOrDefault();
 977:   
 978:                                                      break;
 979:                                                  }
 980:                                              case "serviceRequestStatusLabel": l.Text = Ia.Ngn.Cl.Model.Data.ServiceRequest.StatusSortedList[serviceRequest.Status].ToString(); break;
 981:                                              case "serviceRequestCustomerCategoryIdLabel": l.Text = Ia.Ngn.Cl.Model.Data.ServiceRequest.CustomerCategorySortedList[serviceRequest.CustomerCategoryId].ToString(); break;
 982:                                              case "serviceRequestServiceIdLabel":
 983:                                                  {
 984:                                                      if (Ia.Ngn.Cl.Model.Data.ServiceRequest.ServiceSortedList.ContainsKey(serviceRequest.ServiceId))
 985:                                                      {
 986:                                                          l.Text = Ia.Ngn.Cl.Model.Data.ServiceRequest.ServiceSortedList[serviceRequest.ServiceId].ToString();
 987:                                                      }
 988:                                                      else l.Text = "Error: Service '" + serviceRequest.ServiceId + "' not found. ";
 989:   
 990:                                                      break;
 991:                                                  };
 992:   
 993:                                              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;
 994:   
 995:                                              case "serviceRequestServiceCategoryIdLabel": l.Text = Ia.Ngn.Cl.Model.Data.ServiceRequest.ServiceCategorySortedList[serviceRequest.ServiceCategoryId].ToString(); break;
 996:                                              case "serviceRequestCustomerNameLabel": l.Text = serviceRequest.CustomerName; break;
 997:                                              case "serviceRequestServiceServiceTypeLabel": l.Text = Ia.Ngn.Cl.Model.Data.ServiceRequest.ServiceSortedList[serviceRequestService.ServiceType].ToString(); break;
 998:                                              case "serviceRequestServiceTypeLabel": l.Text = "??"; break;
 999:                                              case "serviceRequestServiceProvisionedLabel": l.Text = Ia.Cl.Model.Default.YesNo(serviceRequestService.Provisioned); break;
1000:                                              case "serviceRequestServiceCallWaitingLabel": l.Text = Ia.Cl.Model.Default.YesNo(serviceRequestService.CallWaiting); break;
1001:                                              case "serviceRequestServiceCallForwardingLabel": l.Text = Ia.Cl.Model.Default.YesNo(serviceRequestService.CallForwarding); break;
1002:                                              case "serviceRequestServiceAlarmCallLabel": l.Text = Ia.Cl.Model.Default.YesNo(serviceRequestService.AlarmCall); break;
1003:                                              case "serviceRequestServiceInternationalCallingUserControlledLabel": l.Text = Ia.Cl.Model.Default.YesNo(serviceRequestService.InternationalCallingUserControlled); break;
1004:                                              case "serviceRequestServiceInternationalCallingLabel": l.Text = Ia.Cl.Model.Default.YesNo(serviceRequestService.InternationalCalling); break;
1005:                                              case "serviceRequestServiceCallerIdLabel": l.Text = Ia.Cl.Model.Default.YesNo(serviceRequestService.CallerId); break;
1006:                                              case "serviceRequestServiceConferenceCallLabel": l.Text = Ia.Cl.Model.Default.YesNo(serviceRequestService.ConferenceCall); break;
1007:                                              case "serviceRequestServiceAbbriviatedCallingLabel": l.Text = Ia.Cl.Model.Default.YesNo(serviceRequestService.AbbriviatedCalling); break;
1008:                                              case "serviceRequestServiceCallBarringLabel": l.Text = Ia.Cl.Model.Default.YesNo(serviceRequestService.CallBarring); break;
1009:                                              case "serviceRequestServiceServiceSuspensionLabel": l.Text = Ia.Cl.Model.Default.YesNo(serviceRequestService.ServiceSuspension); break;
1010:   
1011:                                              case "serviceInitialStateTypeLabel": l.Text = Ia.Ngn.Cl.Model.Data.ServiceRequest.ServiceSortedList[serviceInitialState.ServiceType].ToString(); break;
1012:   
1013:                                              case "accessAreaLabel": l.Text = (from kna in Ia.Ngn.Cl.Model.Data.Service.KuwaitNgnAreaList where kna.Id == access.AreaId select kna.ArabicName).SingleOrDefault(); break;
1014:                                              case "accessOltLabel": l.Text = (from o in Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.OltList where o.Id == access.Olt select o.AmsName).SingleOrDefault(); break;
1015:                                              case "accessBlockLabel": l.Text = access.Block.ToString(); break;
1016:                                              case "accessStreetLabel": l.Text = access.Street; break;
1017:                                              case "accessPremisesOldLabel": l.Text = access.PremisesOld; break;
1018:                                              case "accessPremisesNewLabel": l.Text = access.PremisesNew; break;
1019:                                              case "accessPaciLabel": l.Text = access.Paci; break;
1020:                                              case "accessNoteLabel": l.Text = access.Note; break;
1021:                                              case "accessStaffNameLabel": l.Text = (from _s in Ia.Ngn.Cl.Model.Data.Staff.List where _s.UserId == access.UserId select _s.FirstName).SingleOrDefault(); break;
1022:                                              case "accessOntFamilyTypeCapacityLabel":
1023:                                                  {
1024:                                                      // temp: later quickly find vendor from accessId
1025:                                                      if (access.Onts != null && access.Onts.Count > 0)
1026:                                                      {
1027:                                                          l.Text = Ia.Ngn.Cl.Model.Data.Nokia.Ont.FamilyTypeFromId(access.Onts.FirstOrDefault().FamilyTypeId);
1028:   
1029:                                                          l.Text += " (" + Ia.Ngn.Cl.Model.Business.Nokia.Ams.PossibleNumberOfTdForOntFamilyType(access.Onts.FirstOrDefault().FamilyTypeId) + ")";
1030:                                                      }
1031:                                                      else if (access.EmsOnts != null && access.EmsOnts.Count > 0)
1032:                                                      {
1033:                                                          l.Text = Ia.Ngn.Cl.Model.Business.Huawei.Ont.FamilyTypeStringFromEquipmentType(access.EmsOnts.FirstOrDefault().EquipmentType);
1034:   
1035:                                                          l.Text += " (" + Ia.Ngn.Cl.Model.Business.Huawei.Ems.PossibleNumberOfTdForOntEquipmentType(access.EmsOnts.FirstOrDefault().EquipmentType) + ")";
1036:                                                      }
1037:                                                      else l.Text = "";
1038:   
1039:                                                      break;
1040:                                                  }
1041:   
1042:                                              case "accessFamilyTypeInAreaBlockLabel": l.Text = (from kna in Ia.Ngn.Cl.Model.Data.Service.KuwaitNgnAreaList where kna.Id == accessFamilyTypeInAreaBlock.AreaId select kna.NameArabicName).SingleOrDefault(); break;
1043:   
1044:                                              case "service2ServiceTypeLabel": l.Text = Ia.Ngn.Cl.Model.Data.ServiceRequest.ServiceSortedList[service2.ServiceType].ToString(); break;
1045:                                              case "service2CallWaitingLabel": l.Text = Ia.Cl.Model.Default.YesNo(service2.CallWaiting); break;
1046:                                              case "service2CallForwardingLabel": l.Text = Ia.Cl.Model.Default.YesNo(service2.CallForwarding); break;
1047:                                              case "service2AlarmCallLabel": l.Text = Ia.Cl.Model.Default.YesNo(service2.AlarmCall); break;
1048:                                              case "service2InternationalCallingUserControlledLabel": l.Text = Ia.Cl.Model.Default.YesNo(service2.InternationalCallingUserControlled); break;
1049:                                              case "service2InternationalCallingLabel": l.Text = Ia.Cl.Model.Default.YesNo(service2.InternationalCalling); break;
1050:                                              case "service2CallerIdLabel": l.Text = Ia.Cl.Model.Default.YesNo(service2.CallerId); break;
1051:                                              case "service2ConferenceCallLabel": l.Text = Ia.Cl.Model.Default.YesNo(service2.ConferenceCall); break;
1052:                                              case "service2AbbriviatedCallingLabel": l.Text = Ia.Cl.Model.Default.YesNo(service2.AbbriviatedCalling); break;
1053:                                              case "service2CallBarringLabel": l.Text = Ia.Cl.Model.Default.YesNo(service2.CallBarring); break;
1054:                                              case "service2ServiceSuspensionLabel": l.Text = Ia.Cl.Model.Default.YesNo(service2.ServiceSuspension); break;
1055:   
1056:                                              case "isPrimaryAgcfGatewayRecordLabel": l.Text = Ia.Cl.Model.Default.YesNo(agcfGatewayRecord.IsPrimary); break;
1057:   
1058:                                              case "ontFamilyTypeLabel": l.Text = Ia.Ngn.Cl.Model.Data.Nokia.Ont.FamilyTypeFromId(ont.FamilyTypeId); break;
1059:                                              case "ontStateIdLabel": l.Text = Ia.Ngn.Cl.Model.Data.Nokia.Ams.BellcoreStateFromId(ont.StateId); break;
1060:                                              case "ontServiceVoipStateIdLabel": l.Text = Ia.Ngn.Cl.Model.Data.Nokia.Ams.BellcoreStateFromId(ontServiceVoip.StateId); break;
1061:                                              case "ontServiceVoipMgcIpLabel": l.Text = ontServiceVoip.MgcIp; break;
1062:                                              case "ontOntPotsStateIdLabel": l.Text = Ia.Ngn.Cl.Model.Data.Nokia.Ams.BellcoreStateFromId(ontOntPots.StateId); break;
1063:                                              case "ontVendorLabel": l.Text = Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.VendorNameFromId(ont.VendorId); break;
1064:   
1065:                                              case "userNameLabel": l.Text = membershipUser.UserName; break;
1066:                                              case "userEmailLabel": l.Text = membershipUser.Email; break;
1067:   
1068:                                              case "staffIsHeadLabel": l.Text = Ia.Cl.Model.Default.YesNoInArabic(staff.IsHead); break;
1069:                                              case "staffFirstNameLabel": l.Text = staff.FirstName; break;
1070:                                              case "staffMiddleNameLabel": l.Text = staff.MiddleName; break;
1071:                                              case "staffLastNameLabel": l.Text = staff.LastName; break;
1072:                                              case "staffIpPbxExtensionLabel": l.Text = staff.IpPbxExtension; break;
1073:                                              case "staffEmploymentIdLabel": l.Text = staff.EmploymentId.ToString(); break;
1074:                                              case "staffAdministrativeFrameworkIdLabel": l.Text = (from f in Ia.Ngn.Cl.Model.Data.Administration.FrameworkList where f.Id == staff.AdministrativeFrameworkId select f.ArabicName).SingleOrDefault(); break;
1075:                                              case "staffIdentityUserIdLabel": l.Text = Ia.Cl.Model.Identity.UserNameDictionary[staff.UserId]; break;
1076:                                              case "staffUserEmailLabel":
1077:                                                  {
1078:                                                      lock (Ia.Cl.Model.Identity.UserList) userList = Ia.Cl.Model.Identity.UserList;
1079:   
1080:                                                      l.Text = (from u in userList where u.ProviderUserKey == staff.UserId select u.Email).SingleOrDefault();
1081:                                                      break;
1082:                                                  }
1083:   
1084:                                              case "contactFirstNameLabel": l.Text = contact.FirstName; break;
1085:                                              case "contactMiddleNameLabel": l.Text = contact.MiddleName; break;
1086:                                              case "contactLastNameLabel": l.Text = contact.LastName; break;
1087:                                              case "contactCompanyLabel": l.Text = contact.Company; break;
1088:                                              case "contactEmailLabel": l.Text = contact.Email; break;
1089:                                              case "contactPhoneLabel": l.Text = contact.Phone; break;
1090:                                              case "contactAddressLabel": l.Text = contact.Address; break;
1091:                                              case "contactApprovedLabel": l.Text = Ia.Cl.Model.Default.YesNoInArabic(contact.IsApproved); break;
1092:                                              case "contactUrlLabel": l.Text = contact.Url; break;
1093:                                              case "contactNoteLabel": l.Text = contact.Note; break;
1094:                                              case "contactUserIdLabel": l.Text = contact.UserId.ToString(); break;
1095:   
1096:                                              case "reportUserNameLabel": l.Text = "?"; break;
1097:                                              case "reportStaffFrameworkLabel":
1098:                                                  {
1099:                                                      if (Ia.Ngn.Cl.Model.Business.Administration.IsFrameworkGuid(report.UserId))
1100:                                                      {
1101:                                                          l.Text = (from f in Ia.Ngn.Cl.Model.Data.Administration.FrameworkList where f.Guid == report.UserId select f.ArabicName).SingleOrDefault();
1102:                                                      }
1103:                                                      else l.Text = (from _s in Ia.Ngn.Cl.Model.Data.Staff.List where _s.UserId == report.UserId select _s.FirstAndMiddleName).SingleOrDefault();
1104:   
1105:                                                      if (report.LastReportHistory.UserId == staffMembershipUser.UserId)
1106:                                                      {
1107:                                                          //e.Row.BackColor = System.Drawing.Color.SlateGray;
1108:                                                      }
1109:   
1110:                                                      break;
1111:                                                  }
1112:                                              case "accessAreaStatisticLabel": l.Text = (from kna in Ia.Ngn.Cl.Model.Data.Service.KuwaitNgnAreaList where kna.Id == areaId select kna.ArabicName).SingleOrDefault(); break;
1113:   
1114:   
1115:                                              case "subscriberCallWaitingLabel":
1116:                                                  {
1117:                                                      l.Text = Ia.Cl.Model.Default.YesNo(subscriber.CallWaiting);
1118:   
1119:                                                      break;
1120:                                                  }
1121:                                              case "subPartyIsSipLabel":
1122:                                                  {
1123:                                                      l.Text = Ia.Cl.Model.Default.YesNo(Ia.Ngn.Cl.Model.Business.Nokia.SubParty.IsSip(subParty.PrimaryPUIDCPEProfileNumber));
1124:   
1125:                                                      break;
1126:                                                  }
1127:                                              case "subscriberCallForwardingLabel":
1128:                                                  {
1129:                                                      l.Text = Ia.Cl.Model.Default.YesNo(subscriber.CallForwarding);
1130:   
1131:                                                      break;
1132:                                                  }
1133:                                              case "subscriberAlarmCallLabel":
1134:                                                  {
1135:                                                      l.Text = Ia.Cl.Model.Default.YesNo(subscriber.AlarmCall);
1136:   
1137:                                                      break;
1138:                                                  }
1139:                                              case "subscriberInternationalCallingUserControlledLabel":
1140:                                                  {
1141:                                                      l.Text = Ia.Cl.Model.Default.YesNo(subscriber.InternationalCallingUserControlled);
1142:   
1143:                                                      break;
1144:                                                  }
1145:                                              case "subscriberInternationalCallingLabel":
1146:                                                  {
1147:                                                      l.Text = Ia.Cl.Model.Default.YesNo(subscriber.InternationalCalling);
1148:   
1149:                                                      break;
1150:                                                  }
1151:                                              case "subscriberCallerIdLabel":
1152:                                                  {
1153:                                                      l.Text = Ia.Cl.Model.Default.YesNo(subscriber.CallerId);
1154:   
1155:                                                      break;
1156:                                                  }
1157:                                              case "subscriberConferenceCallLabel":
1158:                                                  {
1159:                                                      l.Text = Ia.Cl.Model.Default.YesNo(subscriber.ConferenceCall);
1160:   
1161:                                                      break;
1162:                                                  }
1163:                                              case "subscriberAbbriviatedCallingLabel":
1164:                                                  {
1165:                                                      l.Text = Ia.Cl.Model.Default.YesNo(subscriber.AbbriviatedCalling);
1166:   
1167:                                                      break;
1168:                                                  }
1169:                                              case "subscriberCallBarringLabel":
1170:                                                  {
1171:                                                      l.Text = "?"; // Ia.Cl.Model.Default.YesNo(subscriber.??);
1172:   
1173:                                                      break;
1174:                                                  }
1175:                                              case "subscriberServiceSuspensionLabel":
1176:                                                  {
1177:                                                      l.Text = "?"; // Ia.Cl.Model.Default.YesNo(subscriber.ServiceSuspension);
1178:   
1179:                                                      break;
1180:                                                  }
1181:   
1182:   
1183:                                              case "nddOntPonPositionLabel": l.Text = nddOnt.Pon.Position; break;
1184:                                              case "nddOntPonOltOdfSiteNameLabel": l.Text = nddOnt.Pon.PonGroup.Olt.Odf.Router.Site.Name; break;
1185:                                              case "nddOntPonOltOdfSiteNameArabicNameLabel": l.Text = nddOnt.Pon.PonGroup.Olt.Odf.Router.Site.Name + " (" + nddOnt.Pon.PonGroup.Olt.Odf.Router.Site.ArabicName + ")"; break;
1186:                                              case "nddOntPonOltAmsNameLabel": l.Text = nddOnt.Pon.PonGroup.Olt.AmsName; break;
1187:                                              case "nddOntPonOltAreaLabel": l.Text = nddOnt.Pon.PonGroup.Olt.Symbol; break;
1188:                                              case "nddOntPrimarySwitchLabel": l.Text = nddOnt.PrimarySwitch; break;
1189:                                              case "nddOntPonOltIsSipLabel": l.Text = Ia.Cl.Model.Default.YesNo(nddOnt.Pon.PonGroup.Olt.IsSip); break;
1190:   
1191:                                              case "nddOntMgcIpLabel": l.Text = nddOnt.MgcIp; break;
1192:                                              case "nddOntMgcSecondaryIpLabel": l.Text = nddOnt.MgcSecondaryIp; break;
1193:                                              case "nddOntPonOltVlanLabel": l.Text = "?"; break; // nddOnt.Pon.PonGroup.Olt.Vlan.ToString(); break;
1194:                                              case "nddOntPonOltNetworkNumberLabel": l.Text = nddOnt.Pon.PonGroup.NetworkNumber; break;
1195:                                              case "nddOntPonOltGatewayIpLabel": l.Text = nddOnt.Pon.PonGroup.GatewayIp; break;
1196:                                              case "nddOntImsServiceLabel": l.Text = nddOnt.ImsService.ToString(); break;
1197:                                              case "nddOntImsFsdbLabel": l.Text = nddOnt.ImsFsdb; break;
1198:   
1199:                                              case "nddOntProposedNameLabel":
1200:                                                  {
1201:                                                      if (nddOnt.Pon.PonGroup.HasNewProposedPonList)
1202:                                                      {
1203:                                                          l.Text = nddOnt.Access.ProposedName;
1204:                                                      }
1205:                                                      else
1206:                                                      {
1207:                                                          ((GridView)e.Row.Parent.Parent).Columns[5].Visible = false;
1208:                                                          // 5 is position (0 based) of HeaderText="Proposed Name"
1209:                                                      }
1210:   
1211:                                                      break;
1212:                                                  }
1213:   
1214:                                              case "nddOntPonOltOdfAccessVendorNameLabel": l.Text = nddOnt.Pon.PonGroup.Olt.Odf.Vendor.Name; break;
1215:                                              case "nddOntPonOltOdfRouterSwitchVendorNameLabel": l.Text = nddOnt.Pon.PonGroup.Olt.Odf.Router.Vendor.Name; break;
1216:   
1217:                                              case "serviceExemptionNoteLabel": l.Text = serviceExemption.Note; break;
1218:                                              case "serviceExemptionStaffNameLabel": l.Text = (from _s in Ia.Ngn.Cl.Model.Data.Staff.List where _s.UserId == serviceExemption.UserId select _s.FirstName).SingleOrDefault(); break;
1219:   
1220:                                              case "serviceRequestOntAreaLabel": l.Text = (from kna in Ia.Ngn.Cl.Model.Data.Service.KuwaitNgnAreaList where kna.Symbol == serviceRequestOnt.AreaSymbol select kna.ArabicName).SingleOrDefault(); break;
1221:   
1222:                                              case "serviceRequestOntDetailServiceTypeLabel": l.Text = Ia.Ngn.Cl.Model.Data.ServiceRequest.ServiceSortedList[serviceRequestOntDetail.ServiceType].ToString(); break;
1223:   
1224:                                              default: break;
1225:                                          }
1226:   
1227:                                          /*
1228:                                          else if (l.ID == "service_request_ont_l")
1229:                                          {
1230:                                              // below: indicate if number is in customer dept ready database
1231:                                              if (drv["service_request_ont"] == DBNull.Value)
1232:                                              {
1233:                                                  l.Text = l.Text = "No";
1234:                                                  l.ForeColor = System.Drawing.Color.Red;
1235:                                              }
1236:                                              else
1237:                                              {
1238:                                                  l.Text = l.Text = "Ready (جاهز)";
1239:                                                  l.ForeColor = System.Drawing.Color.Green;
1240:                                              }
1241:                                          }
1242:                                           */
1243:                                      }
1244:                                      else if (control.Controls[0].GetType().ToString() == "System.Web.UI.WebControls.HyperLink")
1245:                                      {
1246:                                          HyperLink hl = (HyperLink)control.Controls[0];
1247:   
1248:                                          switch (hl.ID)
1249:                                          {
1250:                                              case "reportServiceHyperLink":
1251:                                                  {
1252:                                                      s = Ia.Ngn.Cl.Model.Business.Service.ServiceName(report.Service, report.ServiceType);
1253:                                                      hl.Text = s;
1254:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + s;
1255:                                                      break;
1256:                                                  }
1257:                                              case "reportAccessServiceRequestServiceHyperLink":
1258:                                                  {
1259:                                                      s = Ia.Ngn.Cl.Model.Business.Service.ServiceName(reportAccessServiceRequest.Report.Service, reportAccessServiceRequest.Report.ServiceType);
1260:                                                      hl.Text = s;
1261:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + s;
1262:                                                      break;
1263:                                                  }
1264:                                              case "serviceRequestNumberSerialHyperLink":
1265:                                                  {
1266:                                                      hl.Text = serviceRequest.Number + "/" + serviceRequest.Serial;
1267:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + serviceRequest.Number;
1268:                                                      break;
1269:                                                  }
1270:                                              case "serviceRequestCustomerNameHyperLink":
1271:                                                  {
1272:                                                      hl.Text = serviceRequest.CustomerName;
1273:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + HttpUtility.UrlEncode(serviceRequest.CustomerName);
1274:                                                      break;
1275:                                                  }
1276:                                              case "impuHuSbrGridViewServiceHyperLink":
1277:                                                  {
1278:                                                      hl.Text = huSbr.IMPU;
1279:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + HttpUtility.UrlEncode(huSbr.IMPU);
1280:                                                      break;
1281:                                                  }
1282:                                              case "impuOwsbrGridViewServiceHyperLink":
1283:                                                  {
1284:                                                      hl.Text = owsbr.IMPU;
1285:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + HttpUtility.UrlEncode(owsbr.IMPU);
1286:                                                      break;
1287:                                                  }
1288:                                              case "accessPositionHyperLink":
1289:                                                  {
1290:                                                      hl.Text = access.Position;
1291:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + access.Position;
1292:   
1293:                                                      break;
1294:                                                  }
1295:                                              case "ontSerialHyperLink":
1296:                                                  {
1297:                                                      hl.Text = ont.Serial;
1298:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + ont.Serial;
1299:                                                      break;
1300:                                                  }
1301:                                              case "reportAccessServiceRequestAccessNameHyperLink":
1302:                                                  {
1303:                                                      hl.Text = reportAccessServiceRequest.Access.Name;
1304:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + reportAccessServiceRequest.Access.Name;
1305:                                                      break;
1306:                                                  }
1307:                                              case "nddOntNameHyperLink":
1308:                                                  {
1309:                                                      hl.Text = nddOnt.Access.Name;
1310:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + nddOnt.Access.Name;
1311:                                                      break;
1312:                                                  }
1313:                                              case "nddOntPonNameHyperLink":
1314:                                                  {
1315:                                                      hl.Text = nddOnt.Pon.Name;
1316:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + nddOnt.Pon.Name;
1317:                                                      break;
1318:                                                  }
1319:                                              case "nddOntPositionHyperLink":
1320:                                                  {
1321:                                                      hl.Text = nddOnt.Position;
1322:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + nddOnt.Position;
1323:                                                      break;
1324:                                                  }
1325:                                              case "nddOntIpHyperLink":
1326:                                                  {
1327:                                                      hl.Text = nddOnt.Ip;
1328:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + nddOnt.Ip;
1329:                                                      break;
1330:                                                  }
1331:                                              case "serviceRequestServiceServiceHyperLink":
1332:                                                  {
1333:                                                      s = Ia.Ngn.Cl.Model.Business.Service.ServiceName(serviceRequestService.Service, serviceRequestService.ServiceType);
1334:   
1335:                                                      hl.Text = s;
1336:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + s;
1337:                                                      break;
1338:                                                  }
1339:                                              case "serviceRequestServiceAccessNameHyperLink":
1340:                                                  {
1341:                                                      if (serviceRequestService.Access != null)
1342:                                                      {
1343:                                                          hl.Text = serviceRequestService.Access.Name;
1344:                                                          hl.NavigateUrl = "~/maintenance/find.aspx?input=" + serviceRequestService.Access.Name;
1345:                                                      }
1346:                                                      break;
1347:                                                  }
1348:                                              case "serviceInitialStateHyperLink":
1349:                                                  {
1350:                                                      s = Ia.Ngn.Cl.Model.Business.Service.ServiceName(serviceInitialState.Service, serviceInitialState.ServiceType);
1351:   
1352:                                                      hl.Text = s;
1353:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + s;
1354:                                                      break;
1355:                                                  }
1356:                                              case "serviceInitialStateAccessNameHyperLink":
1357:                                                  {
1358:                                                      if (serviceInitialState.Access != null)
1359:                                                      {
1360:                                                          hl.Text = serviceInitialState.Access.Name;
1361:                                                          hl.NavigateUrl = "~/maintenance/find.aspx?input=" + serviceInitialState.Access.Name;
1362:                                                      }
1363:                                                      break;
1364:                                                  }
1365:                                              case "serviceRequestNumberHyperLink":
1366:                                                  {
1367:                                                      hl.Text = serviceRequest.Number.ToString();
1368:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + serviceRequest.Number.ToString();
1369:                                                      break;
1370:                                                  }
1371:                                              case "serviceRequestCustomerIdHyperLink":
1372:                                                  {
1373:                                                      hl.Text = serviceRequest.CustomerId.ToString();
1374:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + serviceRequest.CustomerId.ToString() + "&inputType=" + Ia.Ngn.Cl.Model.Business.ServiceRequest.ServiceRequestCustomerIdInputTypeString;
1375:                                                      break;
1376:                                                  }
1377:                                              case "accessOdfHyperLink":
1378:                                                  {
1379:                                                      hl.Text = access.Odf;
1380:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + access.Odf;
1381:                                                      break;
1382:                                                  }
1383:                                              case "accessNameHyperLink":
1384:                                                  {
1385:                                                      hl.Text = access.Name;
1386:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + access.Name;
1387:                                                      break;
1388:                                                  }
1389:                                              case "accessBlockHyperLink":
1390:                                                  {
1391:                                                      int i;
1392:                                                      string areaSymbol;
1393:   
1394:                                                      if (int.TryParse(access.Block, out i))
1395:                                                      {
1396:                                                          hl.Text = access.Block;
1397:                                                          areaSymbol = (from kna in Ia.Ngn.Cl.Model.Data.Service.KuwaitNgnAreaList where kna.Id == access.AreaId select kna.Symbol).SingleOrDefault();
1398:   
1399:                                                          if (!string.IsNullOrEmpty(areaSymbol))
1400:                                                          {
1401:                                                              hl.NavigateUrl = "~/maintenance/find.aspx?input=" + areaSymbol + "," + access.Block;
1402:                                                          }
1403:                                                          else
1404:                                                          {
1405:   
1406:                                                          }
1407:                                                      }
1408:                                                      else
1409:                                                      {
1410:   
1411:                                                      }
1412:   
1413:                                                      break;
1414:                                                  }
1415:   
1416:                                              case "service2ServiceHyperLink":
1417:                                                  {
1418:                                                      s = Ia.Ngn.Cl.Model.Business.Service.ServiceName(service2.Service, service2.ServiceType);
1419:   
1420:                                                      hl.Text = s;
1421:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + s;
1422:                                                      break;
1423:                                                  }
1424:                                              case "service2AccessNameHyperLink":
1425:                                                  {
1426:                                                      if (service2.AccessName != null)
1427:                                                      {
1428:                                                          hl.Text = service2.AccessName;
1429:                                                          hl.NavigateUrl = "~/maintenance/find.aspx?input=" + service2.AccessName;
1430:                                                      }
1431:                                                      break;
1432:                                                  }
1433:   
1434:                                              case "newOntEventAccessNameHyperLink":
1435:                                                  {
1436:                                                      if (newOntEvent.AccessName != null)
1437:                                                      {
1438:                                                          hl.Text = newOntEvent.AccessName;
1439:                                                          hl.NavigateUrl = "~/maintenance/find.aspx?input=" + newOntEvent.AccessName;
1440:                                                      }
1441:                                                      break;
1442:                                                  }
1443:                                              case "serviceExemptionServiceLabel":
1444:                                                  {
1445:                                                      s = Ia.Ngn.Cl.Model.Business.Service.ServiceName(serviceExemption.Service, serviceExemption.ServiceType);
1446:   
1447:                                                      hl.Text = s;
1448:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + s;
1449:                                                      break;
1450:                                                  }
1451:                                              case "gwIdAgcfGatewayRecordHyperLink":
1452:                                                  {
1453:                                                      hl.Text = agcfGatewayRecord.GwId.ToString();
1454:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + agcfGatewayRecord.GwId;
1455:                                                      break;
1456:                                                  }
1457:                                              case "ip1AgcfGatewayRecordHyperLink":
1458:                                                  {
1459:                                                      hl.Text = agcfGatewayRecord.IP1;
1460:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + agcfGatewayRecord.IP1;
1461:                                                      break;
1462:                                                  }
1463:                                              case "ip2AgcfGatewayRecordHyperLink":
1464:                                                  {
1465:                                                      hl.Text = agcfGatewayRecord.IP2;
1466:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + agcfGatewayRecord.IP2;
1467:                                                      break;
1468:                                                  }
1469:                                              case "gwIdAgcfEndpointHyperLink":
1470:                                                  {
1471:                                                      hl.Text = agcfEndpoint.GwId.ToString();
1472:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + agcfEndpoint.GwId.ToString();
1473:                                                      break;
1474:                                                  }
1475:                                              case "subPartyDisplayNameHyperLink":
1476:                                                  {
1477:                                                      hl.Text = subParty.DisplayName;
1478:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + subParty.DisplayName;
1479:                                                      break;
1480:                                                  }
1481:                                              case "ontServiceVoipIpHyperLink":
1482:                                                  {
1483:                                                      hl.Text = ontServiceVoip.Ip.ToString();
1484:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + ontServiceVoip.Ip.ToString();
1485:                                                      break;
1486:                                                  }
1487:                                              case "reportHistoryHyperLink":
1488:                                                  {
1489:                                                      //hl.Text = "<img src=" + Ia.Cl.Model.Default.AbsoluteUrl(page) + "/image/legend/history.png class=icon alt=History width=19 height=19 />";
1490:                                                      hl.NavigateUrl = "~/maintenance/report/history.aspx?reportId=" + report.Id;
1491:                                                      break;
1492:                                                  }
1493:                                              case "reportHistoryServiceHyperLink":
1494:                                                  {
1495:                                                      s = Ia.Ngn.Cl.Model.Business.Service.ServiceName(reportHistory.Report.Service, reportHistory.Report.ServiceType);
1496:   
1497:                                                      hl.Text = s;
1498:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + s;
1499:                                                      break;
1500:                                                  }
1501:                                              case "serviceServiceAccessNameHyperLink":
1502:                                                  {
1503:                                                      if (serviceAccessName.Service != null)
1504:                                                      {
1505:                                                          hl.Text = serviceAccessName.Service;
1506:                                                          hl.NavigateUrl = "~/maintenance/find.aspx?input=" + serviceAccessName.Service;
1507:                                                      }
1508:                                                      break;
1509:                                                  }
1510:                                              case "accessNameServiceAccessNameHyperLink":
1511:                                                  {
1512:                                                      if (serviceAccessName.AccessName != null)
1513:                                                      {
1514:                                                          hl.Text = serviceAccessName.AccessName;
1515:                                                          hl.NavigateUrl = "~/maintenance/find.aspx?input=" + serviceAccessName.AccessName;
1516:                                                      }
1517:                                                      break;
1518:                                                  }
1519:                                              case "serviceRequestOntDetailServiceHyperLink":
1520:                                                  {
1521:                                                      s = Ia.Ngn.Cl.Model.Business.Service.ServiceName(serviceRequestOntDetail.Service, serviceRequestOntDetail.ServiceType);
1522:   
1523:                                                      hl.Text = s;
1524:                                                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + s;
1525:                                                      break;
1526:                                                  }
1527:                                              default: break;
1528:                                          }
1529:                                      }
1530:                                      else if (control.Controls[0].GetType().ToString() == "System.Web.UI.WebControls.TextBox")
1531:                                      {
1532:                                          TextBox tb = (TextBox)control.Controls[0];
1533:   
1534:                                          switch (tb.ID)
1535:                                          {
1536:                                              case "staffEmploymentIdTextBox": tb.Text = staff.EmploymentId.ToString(); break;
1537:                                              case "staffFirstNameTextBox": tb.Text = staff.FirstName; break;
1538:                                              case "staffMiddleNameTextBox": tb.Text = staff.MiddleName; break;
1539:                                              case "staffLastNameTextBox": tb.Text = staff.LastName; break;
1540:                                              case "staffIpPbxExtensionTextBox": tb.Text = staff.IpPbxExtension; break;
1541:   
1542:                                              case "contactFirstNameTextBox": tb.Text = contact.FirstName; break;
1543:                                              case "contactMiddleNameTextBox": tb.Text = contact.MiddleName; break;
1544:                                              case "contactLastNameTextBox": tb.Text = contact.LastName; break;
1545:                                              case "contactCompanyTextBox": tb.Text = contact.Company; break;
1546:                                              case "contactEmailTextBox": tb.Text = contact.Email; break;
1547:                                              case "contactPhoneTextBox": tb.Text = contact.Phone; break;
1548:                                              case "contactAddressTextBox": tb.Text = contact.Address; break;
1549:                                              case "contactUrlTextBox": tb.Text = contact.Url; break;
1550:                                              case "contactNoteTextBox": tb.Text = contact.Note; break;
1551:   
1552:                                              case "userNameTextBox": tb.Text = membershipUser.UserName; break;
1553:                                              case "userEmailTextBox": tb.Text = membershipUser.Email; break;
1554:                                              case "accessBlockTextBox": tb.Text = access.Block.ToString(); break;
1555:                                              case "accessStreetTextBox": tb.Text = access.Street; break;
1556:                                              case "accessPremisesOldTextBox": tb.Text = access.PremisesOld; break;
1557:                                              case "accessPremisesNewTextBox": tb.Text = access.PremisesNew; break;
1558:                                              case "accessPaciTextBox": tb.Text = access.Paci; break;
1559:                                              case "accessNoteTextBox": tb.Text = access.Note; break;
1560:   
1561:                                              case "serviceExemptionNoteTextBox": tb.Text = serviceExemption.Note; break;
1562:   
1563:                                              default: break;
1564:                                          }
1565:                                      }
1566:                                      else if (control.Controls[0].GetType().ToString() == "System.Web.UI.WebControls.DropDownList")
1567:                                      {
1568:                                          DropDownList ddl = (DropDownList)control.Controls[0];
1569:   
1570:                                          switch (ddl.ID)
1571:                                          {
1572:                                              case "staffAdministrativeFrameworkIdDropDownList":
1573:                                                  {
1574:                                                      ddl.DataSource = Ia.Ngn.Cl.Model.Data.Administration.FrameworkList;
1575:                                                      ddl.DataValueField = "Id";
1576:                                                      ddl.DataTextField = "FullyQualifiedArabicName";
1577:                                                      ddl.DataBind();
1578:   
1579:                                                      ddl.SelectedIndex = ddl.Items.IndexOf(ddl.Items.FindByValue(staff.AdministrativeFrameworkId.ToString()));
1580:                                                      break;
1581:                                                  }
1582:   
1583:                                              case "staffIdentityUserIdDropDownList":
1584:                                                  {
1585:                                                      ddl.Items.Clear();
1586:   
1587:                                                      lock (Ia.Cl.Model.Identity.UserList) userList = Ia.Cl.Model.Identity.UserList;
1588:   
1589:                                                      ddl.DataSource = userList;
1590:                                                      ddl.DataValueField = "ProviderUserKey";
1591:                                                      ddl.DataTextField = "UserName";
1592:                                                      ddl.DataBind();
1593:   
1594:                                                      ddl.Items.Insert(0, new ListItem("Empty Guid", Guid.Empty.ToString()));
1595:                                                      ddl.SelectedIndex = ddl.Items.IndexOf(ddl.Items.FindByValue(staff.UserId.ToString()));
1596:                                                      break;
1597:                                                  }
1598:   
1599:                                              default: break;
1600:                                          }
1601:                                      }
1602:                                      else if (control.Controls[0].GetType().ToString() == "System.Web.UI.WebControls.CheckBox")
1603:                                      {
1604:                                          CheckBox cb = (CheckBox)control.Controls[0];
1605:   
1606:                                          switch (cb.ID)
1607:                                          {
1608:                                              case "staffIsHeadCheckBox": cb.Checked = staff.IsHead; break;
1609:                                              case "contactApprovedCheckBox": cb.Checked = contact.IsApproved; break;
1610:                                              default: break;
1611:                                          }
1612:                                      }
1613:                                      else if (control.Controls[0].GetType().ToString() == "System.Web.UI.WebControls.Image")
1614:                                      {
1615:                                          Image im = (Image)control.Controls[0];
1616:   
1617:                                          switch (im.ID)
1618:                                          {
1619:                                              case "deleteImage": break;
1620:                                              case "historyImage": break;
1621:                                              case "nddOntPonOltOdfAccessVendorIconImage":
1622:                                                  {
1623:                                                      vendor = (from o in Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.OntList where o.Id == nddOnt.Id select o.Pon.PonGroup.Olt.Odf.Vendor).SingleOrDefault();
1624:                                                      im.ImageUrl = vendor.ImageUrl;
1625:                                                      im.ToolTip = vendor.Name;
1626:                                                      break;
1627:                                                  }
1628:                                              case "nddOntPonOltOdfRouterSwitchVendorIconImage":
1629:                                                  {
1630:                                                      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();
1631:                                                      im.ImageUrl = vendor.ImageUrl;
1632:                                                      im.ToolTip = vendor.Name;
1633:                                                      break;
1634:                                                  }
1635:                                              /*
1636:                                          case "ontAccessOntPonOltOdfVendorIconImage":
1637:                                              {
1638:                                                  vendor = (from q in Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.OntList where q.Id == ont.Id select q.Pon.PonGroup.Olt.Odf.Vendor).SingleOrDefault();
1639:                                                  im.ImageUrl = vendor.ImageUrl;
1640:                                                  im.ToolTip = vendor.Name;
1641:                                                  break;
1642:                                              }
1643:                                              */
1644:                                              case "accessOntPonOltOdfVendorIconImage":
1645:                                                  {
1646:                                                      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();
1647:                                                      im.ImageUrl = vendor.ImageUrl;
1648:                                                      im.ToolTip = vendor.Name;
1649:                                                      break;
1650:                                                  }
1651:                                              default: break;
1652:                                          }
1653:                                      }
1654:                                      else
1655:                                      {
1656:   
1657:                                      }
1658:                                  }
1659:                              }
1660:                              catch (Exception)
1661:                              {
1662:                              }
1663:                          }
1664:                      }
1665:                      else if (e.Row.RowType == DataControlRowType.Footer)
1666:                      {
1667:                      }
1668:                      else
1669:                      {
1670:                      }
1671:                  }
1672:                  else
1673:                  {
1674:                  }
1675:              }
1676:              else
1677:              {
1678:              }
1679:          }
1680:   
1681:          ////////////////////////////////////////////////////////////////////////////
1682:          ////////////////////////////////////////////////////////////////////////////
1683:   
1684:          /// <summary>
1685:          ///
1686:          /// </summary>
1687:          public static void DropDownList_DataBound(System.Web.UI.Page page, object sender, EventArgs e, Ia.Ngn.Cl.Model.Staff staff)
1688:          {
1689:              string kuwaitNgnAreaListString;
1690:              DropDownList ddl;
1691:              List<Ia.Ngn.Cl.Model.Business.Service.KuwaitNgnArea> kuwaitNgnAreaList;
1692:   
1693:              ddl = (DropDownList)sender;
1694:   
1695:              foreach (ListItem listItem in ddl.Items)
1696:              {
1697:                  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();
1698:   
1699:                  if (kuwaitNgnAreaList != null && kuwaitNgnAreaList.Count > 0)
1700:                  {
1701:                      kuwaitNgnAreaListString = string.Join(", ", kuwaitNgnAreaList.Select(n => n.ArabicName).ToArray());
1702:                  }
1703:                  else kuwaitNgnAreaListString = null;
1704:   
1705:                  listItem.Text = kuwaitNgnAreaListString;
1706:              }
1707:          }
1708:   
1709:          ////////////////////////////////////////////////////////////////////////////
1710:   
1711:          /// <summary>
1712:          ///
1713:          /// </summary>
1714:          public static void DropDownList_DataBound(System.Web.UI.Page page, object sender, EventArgs e)
1715:          {
1716:              DropDownList_DataBound(page, sender, e, null);
1717:          }
1718:   
1719:          ////////////////////////////////////////////////////////////////////////////
1720:          ////////////////////////////////////////////////////////////////////////////
1721:   
1722:          /// <summary>
1723:          ///
1724:          /// </summary>
1725:          public static void DataList_ItemDataBound(System.Web.UI.Page page, object sender, DataListItemEventArgs e)
1726:          {
1727:              bool senderKnown;
1728:              string s, senderId;
1729:              DataList dataList;
1730:   
1731:              senderKnown = true;
1732:              dataList = (DataList)sender;
1733:              senderId = dataList.ID;
1734:   
1735:              string accessName;
1736:   
1737:              accessName = null;
1738:   
1739:              switch (senderId)
1740:              {
1741:                  case "accessNameDataList":
1742:                      {
1743:                          //access = (e.Item.DataItem as Ia.Ngn.Cl.Model.Access);
1744:                          accessName = (e.Item.DataItem as string);
1745:                          break;
1746:                      }
1747:                  default:
1748:                      senderKnown = false;
1749:                      break;
1750:              }
1751:   
1752:              senderKnown = true;
1753:   
1754:              if (senderKnown)
1755:              {
1756:                  if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
1757:                  {
1758:                      //CheckBox chk = e.Item.FindControl("AApBlue") as CheckBox;
1759:                      //Label lbl = e.Item.FindControl("Label1") as Label;
1760:   
1761:                      //chk.Checked = (lbl.Text == "Y") ? true : false;
1762:   
1763:                      HyperLink hl = e.Item.FindControl("accessNameHyperLink") as HyperLink;
1764:   
1765:                      hl.Text = accessName;
1766:                      hl.NavigateUrl = "~/maintenance/find.aspx?input=" + accessName;
1767:                  }
1768:   
1769:                  //foreach (DataListItem dataListItem in dataList.Items)
1770:                  // {
1771:                  foreach (Control control in dataList.Controls) // dataListItem.Controls)
1772:                  {
1773:                      try
1774:                      {
1775:                          if (control is Label)
1776:                          {
1777:                              // CheckBox cb = (CheckBox)control.Controls[0];
1778:                              Label l = (Label)control;
1779:   
1780:                              switch (l.ID)
1781:                              {
1782:                                  /*
1783:                                  case "accessAreaLabel": l.Text = (from kna in Ia.Ngn.Cl.Model.Data.Service.KuwaitNgnAreaList where kna.Id == accessName.AreaId select kna.ArabicName).SingleOrDefault(); break;
1784:                                  case "accessOltLabel": l.Text = (from o in Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.OltList where o.Id == accessName.Olt select o.AmsName).SingleOrDefault(); break;
1785:                                  case "accessBlockLabel": l.Text = accessName.Block.ToString(); break;
1786:                                  case "accessStreetLabel": l.Text = accessName.Street; break;
1787:                                  case "accessPremisesOldLabel": l.Text = accessName.PremisesOld; break;
1788:                                  case "accessPremisesNewLabel": l.Text = accessName.PremisesNew; break;
1789:                                  case "accessPaciLabel": l.Text = accessName.Paci; break;
1790:                                  case "accessNoteLabel": l.Text = accessName.Note; break;
1791:                                  case "accessStaffNameLabel": l.Text = (from _s in Ia.Ngn.Cl.Model.Data.Staff.List where _s.UserId == accessName.UserId select _s.FirstName).SingleOrDefault(); break;
1792:                                  */    /*
1793:                                  case "accessOntFamilyTypeCapacityLabel":
1794:                                      {
1795:                                          // temp: later quickly find vendor from accessId
1796:                                          try
1797:                                          {
1798:                                              if (access.Onts != null && access.Onts.Count > 0)
1799:                                              {
1800:                                                  l.Text = Ia.Ngn.Cl.Model.Data.Nokia.Ont.FamilyTypeFromId(access.Onts.FirstOrDefault().FamilyTypeId);
1801:  
1802:                                                  l.Text += " (" + Ia.Ngn.Cl.Model.Business.Nokia.Ams.PossibleNumberOfTdForOntFamilyType(access.Onts.FirstOrDefault().FamilyTypeId) + ")";
1803:                                              }
1804:                                              else l.Text = "";
1805:                                          }
1806:                                          catch (Exception)// ex)
1807:                                          {
1808:                                              l.Text = "";
1809:                                          }
1810:  
1811:                                          break;
1812:                                      }
1813:  
1814:                                  case "accessFamilyTypeInAreaBlockLabel": l.Text = (from kna in Ia.Ngn.Cl.Model.Data.Service.KuwaitNgnAreaList where kna.Id == accessFamilyTypeInAreaBlock.AreaId select kna.NameArabicName).SingleOrDefault(); break;
1815:                                  */
1816:                              }
1817:                          }
1818:                          else if (control is HyperLink) // .GetType().ToString() == "System.Web.UI.WebControls.HyperLink")
1819:                          {
1820:                              HyperLink hl = (HyperLink)control;
1821:   
1822:                              switch (hl.ID)
1823:                              {
1824:                                  case "accessNameHyperLink":
1825:                                      {
1826:                                          hl.Text = accessName; //.Name;
1827:                                          hl.NavigateUrl = "~/maintenance/find.aspx?input=" + accessName; //.Name;
1828:                                          break;
1829:                                      }
1830:                                  default:
1831:                                      {
1832:                                          break;
1833:                                      }
1834:                              }
1835:                          }
1836:                          else
1837:                          {
1838:   
1839:                          }
1840:                      }
1841:                      catch (Exception)
1842:                      {
1843:   
1844:                      }
1845:                  }
1846:                  //}
1847:              }
1848:              else
1849:              {
1850:   
1851:              }
1852:          }
1853:   
1854:          ////////////////////////////////////////////////////////////////////////////
1855:          ////////////////////////////////////////////////////////////////////////////
1856:   
1857:          /// <summary>
1858:          ///
1859:          /// </summary>
1860:          public static void FormView_DataBound(System.Web.UI.Page page, object sender, EventArgs e)
1861:          {
1862:          }
1863:   
1864:          ////////////////////////////////////////////////////////////////////////////
1865:          ////////////////////////////////////////////////////////////////////////////
1866:      }
1867:   
1868:      ////////////////////////////////////////////////////////////////////////////
1869:      ////////////////////////////////////////////////////////////////////////////
1870:  }