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

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

Service Request Type support class for Next Generation Network (NGN) data model.

   1:  using System;
   2:  using System.Collections;
   3:  using System.Collections.Generic;
   4:  using System.Xml;
   5:  using System.Xml.Linq;
   6:  using System.Linq;
   7:  using System.Web;
   8:  using System.Web.Security;
   9:  using System.Reflection;
  10:  using System.IO;
  11:  using System.Globalization;
  12:  using System.Text.RegularExpressions;
  13:  using System.Data;
  14:  using System.Data.Entity;
  15:  using Ia.Ngn.Cl.Model.Business; // Needed for ServerExtension
  16:   
  17:  namespace Ia.Ngn.Cl.Model.Data
  18:  {
  19:      ////////////////////////////////////////////////////////////////////////////
  20:   
  21:      /// <summary publish="true">
  22:      /// Service Request Type support class for Next Generation Network (NGN) data model.
  23:      /// </summary>
  24:      /// 
  25:      /// <remarks> 
  26:      /// Copyright © 2006-2017 Jasem Y. Al-Shamlan (info@ia.com.kw), Internet Applications - Kuwait. All Rights Reserved.
  27:      ///
  28:      /// 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
  29:      /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  30:      ///
  31:      /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  32:      /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  33:      /// 
  34:      /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
  35:      /// 
  36:      /// Copyright notice: This notice may not be removed or altered from any source distribution.
  37:      /// </remarks> 
  38:      public partial class ServiceRequestType
  39:      {
  40:          /// <summary/>
  41:          public ServiceRequestType() { }
  42:   
  43:          ////////////////////////////////////////////////////////////////////////////
  44:   
  45:          /// <summary>
  46:          ///
  47:          /// </summary>
  48:          public static List<Ia.Ngn.Cl.Model.ServiceRequestType> ReadListThatHasServiceRequestIdsWithinIdRange(int start, int end)
  49:          {
  50:              List<Ia.Ngn.Cl.Model.ServiceRequestType> serviceRequestTypeList;
  51:   
  52:              using (var db = new Ia.Ngn.Cl.Model.Ngn())
  53:              {
  54:                  serviceRequestTypeList = (from srt in db.ServiceRequestTypes
  55:                                            join sr in db.ServiceRequests
  56:                                            on srt.ServiceRequest.Id equals sr.Id
  57:                                            where sr.Id >= start && sr.Id <= end
  58:                                            select srt).ToList();
  59:              }
  60:   
  61:              return serviceRequestTypeList;
  62:          }
  63:   
  64:          ////////////////////////////////////////////////////////////////////////////
  65:   
  66:          /// <summary>
  67:          ///
  68:          /// </summary>
  69:          public static List<Ia.Ngn.Cl.Model.ServiceRequestType> ReadListThatHaveServiceRequestsWithinGivenDateRange(DateTime startDateTime, DateTime endDateTime)
  70:          {
  71:              List<Ia.Ngn.Cl.Model.ServiceRequestType> serviceRequestTypeList;
  72:   
  73:              using (var db = new Ia.Ngn.Cl.Model.Ngn())
  74:              {
  75:                  serviceRequestTypeList = (from srt in db.ServiceRequestTypes
  76:                                            join sr in db.ServiceRequests
  77:                                            on srt.ServiceRequest.Id equals sr.Id
  78:                                            where sr.RequestDateTime >= startDateTime && sr.RequestDateTime < endDateTime
  79:                                            select srt).ToList();
  80:              }
  81:   
  82:              return serviceRequestTypeList;
  83:          }
  84:   
  85:          ////////////////////////////////////////////////////////////////////////////
  86:   
  87:          /// <summary>
  88:          /// Return a list of service request types for service requests that have numbers within the passed number-serial list
  89:          /// </summary>
  90:          public static List<Ia.Ngn.Cl.Model.ServiceRequestType> ReadListRelatedToServiceRequestNumberList(List<Ia.Ngn.Cl.Model.Business.ServiceRequest.NumberSerial> numberSerialList)
  91:          {
  92:              List<long> idList;
  93:              List<Ia.Ngn.Cl.Model.ServiceRequestType> serviceRequestTypeList;
  94:   
  95:              idList = numberSerialList.IdList();
  96:   
  97:              using (var db = new Ia.Ngn.Cl.Model.Ngn())
  98:              {
  99:                  serviceRequestTypeList = (from srt in db.ServiceRequestTypes
 100:                                            where
 101:                                            //numberSerialList.Contains(q.ServiceRequest.Number, q.ServiceRequest.Serial) 
 102:                                            idList.Contains((long)srt.ServiceRequest.Number * 100 + srt.ServiceRequest.Serial)
 103:                                            select srt).Include(x => x.ServiceRequest).ToList();
 104:              }
 105:   
 106:              return serviceRequestTypeList;
 107:          }
 108:   
 109:          ////////////////////////////////////////////////////////////////////////////
 110:   
 111:          /// <summary>
 112:          /// Return a list of service request types for service requests that have numbers within the passed number list
 113:          /// </summary>
 114:          public static List<Ia.Ngn.Cl.Model.ServiceRequestType> RelatedToServiceRequestNumberList(List<int> numberList)
 115:          {
 116:              List<Ia.Ngn.Cl.Model.ServiceRequestType> serviceRequestTypeList;
 117:   
 118:              using (var db = new Ia.Ngn.Cl.Model.Ngn())
 119:              {
 120:                  serviceRequestTypeList = (from srt in db.ServiceRequestTypes where numberList.Contains(srt.ServiceRequest.Number) select srt).Include(x => x.ServiceRequest).ToList();
 121:              }
 122:   
 123:              return serviceRequestTypeList;
 124:          }
 125:   
 126:          ////////////////////////////////////////////////////////////////////////////    
 127:   
 128:          /// <summary>
 129:          ///
 130:          /// </summary>
 131:          public static string OracleSqlCommandForGivenDateTime(DateTime dateTime)
 132:          {
 133:              string sql;
 134:   
 135:              sql = @"select SRV_REQ_FIPER_TECH.SRV_REQ_ID, SRV_REQ_FIPER_TECH.TECH_TYPE_ID, SRV_REQ_FIPER_TECH.VAL from SRV_REQ_FIPER left outer join SRV_REQ_FIPER_TECH on SRV_REQ_FIPER_TECH.SRV_REQ_ID = SRV_REQ_FIPER.SRV_REQ_ID where REQ_DATE >= '" + dateTime.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture) + @"' and REQ_DATE < '" + dateTime.AddDays(1).ToString("dd/MM/yyyy", CultureInfo.InvariantCulture) + @"' and SRV_REQ_FIPER_TECH.SRV_REQ_ID is not null and SRV_REQ_FIPER_TECH.TECH_TYPE_ID is not null and SRV_REQ_FIPER_TECH.VAL is not null order by SRV_REQ_FIPER.SRV_REQ_ID asc";
 136:   
 137:              return sql;
 138:          }
 139:   
 140:          ////////////////////////////////////////////////////////////////////////////    
 141:   
 142:          /// <summary>
 143:          ///
 144:          /// </summary>
 145:          public static string OracleSqlCommandForServiceRequestIdRange(Tuple<int, int> startEndRange)
 146:          {
 147:              return OracleSqlCommandForServiceRequestIdRange(startEndRange.Item1, startEndRange.Item2);
 148:          }
 149:   
 150:          ////////////////////////////////////////////////////////////////////////////    
 151:   
 152:          /// <summary>
 153:          ///
 154:          /// </summary>
 155:          public static string OracleSqlCommandForServiceRequestIdRange(int start, int end)
 156:          {
 157:              string sql;
 158:   
 159:              sql = @"select SRV_REQ_FIPER_TECH.SRV_REQ_ID, SRV_REQ_FIPER_TECH.TECH_TYPE_ID, SRV_REQ_FIPER_TECH.VAL from SRV_REQ_FIPER left outer join SRV_REQ_FIPER_TECH on SRV_REQ_FIPER_TECH.SRV_REQ_ID = SRV_REQ_FIPER.SRV_REQ_ID where SRV_REQ_FIPER_TECH.SRV_REQ_ID >= " + start + " and SRV_REQ_FIPER_TECH.SRV_REQ_ID <= " + end + " and SRV_REQ_FIPER_TECH.SRV_REQ_ID is not null and SRV_REQ_FIPER_TECH.TECH_TYPE_ID is not null and SRV_REQ_FIPER_TECH.VAL is not null order by SRV_REQ_FIPER.SRV_REQ_ID asc";
 160:   
 161:              return sql;
 162:          }
 163:   
 164:          ////////////////////////////////////////////////////////////////////////////
 165:   
 166:          /// <summary>
 167:          ///
 168:          /// </summary>
 169:          public static void UpdateForServiceRequestIdRangeWithOutputDataTable(DataTable dataTable, Tuple<int, int> startEndRange, out bool isUpdated, out string result)
 170:          {
 171:              // below: the SQL statement should be within the dataTable.TableName variable
 172:              int serviceRequestId, serviceRequestTypeId, start, end, readItemCount, existingItemCount, insertedItemCount, updatedItemCount, deletedItemCount;
 173:              string sql, r;
 174:              ArrayList newServiceRequestTypeIdArryList;
 175:              Match match;
 176:              Ia.Ngn.Cl.Model.ServiceRequestType serviceRequestType, newServiceRequestType;
 177:              List<int> serviceRequestTypeWithNoServiceRequestIdList;
 178:              List<Ia.Ngn.Cl.Model.ServiceRequestType> serviceRequestTypeList;
 179:   
 180:              isUpdated = false;
 181:              readItemCount = existingItemCount = insertedItemCount = updatedItemCount = deletedItemCount = 0;
 182:              result = r = "";
 183:              serviceRequestTypeWithNoServiceRequestIdList = new List<int>();
 184:   
 185:              if (dataTable != null)
 186:              {
 187:                  sql = dataTable.TableName;
 188:   
 189:                  // select SRV_REQ_FIPER_TECH.SRV_REQ_ID, SRV_REQ_FIPER_TECH.TECH_TYPE_ID, SRV_REQ_FIPER_TECH.VAL from SRV_REQ_FIPER left outer join SRV_REQ_FIPER_TECH on SRV_REQ_FIPER_TECH.SRV_REQ_ID = SRV_REQ_FIPER.SRV_REQ_ID where SRV_REQ_FIPER_TECH.SRV_REQ_ID >= 110000 and SRV_REQ_FIPER_TECH.SRV_REQ_ID <= 321203 and SRV_REQ_FIPER_TECH.SRV_REQ_ID is not null and SRV_REQ_FIPER_TECH.TECH_TYPE_ID is not null and SRV_REQ_FIPER_TECH.VAL is not null order by REQ_DATE asc, SRV_REQ_FIPER.SRV_REQ_ID asc
 190:                  match = Regex.Match(sql, @"SRV_REQ_FIPER_TECH\.SRV_REQ_ID >= (\d+) and SRV_REQ_FIPER_TECH\.SRV_REQ_ID <= (\d+) ", RegexOptions.Singleline);
 191:                  //                                       1                       2
 192:   
 193:                  if (match.Success)
 194:                  {
 195:                      using (var db = new Ia.Ngn.Cl.Model.Ngn())
 196:                      {
 197:                          readItemCount = dataTable.Rows.Count;
 198:   
 199:                          start = int.Parse(match.Groups[1].Value);
 200:                          end = int.Parse(match.Groups[2].Value);
 201:   
 202:                          serviceRequestTypeList = Ia.Ngn.Cl.Model.Data.ServiceRequestType.ReadListThatHasServiceRequestIdsWithinIdRange(start, end);
 203:                          existingItemCount = serviceRequestTypeList.Count;
 204:   
 205:                          newServiceRequestTypeIdArryList = new ArrayList(dataTable.Rows.Count + 1);
 206:   
 207:                          foreach (DataRow dataRow in dataTable.Rows)
 208:                          {
 209:                              serviceRequestId = int.Parse(dataRow["SRV_REQ_ID"].ToString());
 210:                              serviceRequestTypeId = int.Parse(serviceRequestId.ToString() + dataRow["TECH_TYPE_ID"].ToString().PadLeft(2, '0'));
 211:   
 212:                              newServiceRequestType = new Ia.Ngn.Cl.Model.ServiceRequestType();
 213:   
 214:                              newServiceRequestType.Id = serviceRequestTypeId;
 215:   
 216:                              newServiceRequestType.ServiceRequest = (from sr in db.ServiceRequests where sr.Id == serviceRequestId select sr).SingleOrDefault();
 217:   
 218:                              // below: we will not add any type that does not have a service request
 219:                              if (newServiceRequestType.ServiceRequest != null)
 220:                              {
 221:                                  newServiceRequestType.TypeId = int.Parse(dataRow["TECH_TYPE_ID"].ToString());
 222:                                  newServiceRequestType.Value = dataRow["VAL"].ToString();
 223:   
 224:                                  FixCommonMistakesAndCheckValidityOfServiceRequestTypeRecords(ref newServiceRequestType);
 225:   
 226:                                  serviceRequestType = (from srt in serviceRequestTypeList where srt.Id == newServiceRequestType.Id select srt).SingleOrDefault();
 227:   
 228:                                  if (serviceRequestType == null)
 229:                                  {
 230:                                      newServiceRequestType.Created = newServiceRequestType.Updated = DateTime.UtcNow.AddHours(3);
 231:   
 232:                                      db.ServiceRequestTypes.Add(newServiceRequestType);
 233:   
 234:                                      insertedItemCount++;
 235:                                  }
 236:                                  else
 237:                                  {
 238:                                      // below: copy values from newServiceRequestType to serviceRequestType
 239:   
 240:                                      if (serviceRequestType.Update(newServiceRequestType))
 241:                                      {
 242:                                          db.ServiceRequestTypes.Attach(serviceRequestType);
 243:                                          db.Entry(serviceRequestType).State = System.Data.Entity.EntityState.Modified;
 244:   
 245:                                          updatedItemCount++;
 246:                                      }
 247:                                  }
 248:   
 249:                                  // below: this will enable the removal of SRT that don't have a valid SR
 250:                                  newServiceRequestTypeIdArryList.Add(serviceRequestTypeId);
 251:                              }
 252:                              else
 253:                              {
 254:                                  serviceRequestTypeWithNoServiceRequestIdList.Add(newServiceRequestType.Id);
 255:                              }
 256:                          }
 257:   
 258:                          /*
 259:                          if (serviceRequestTypeWithNoServiceRequestIdList.Count > 0)
 260:                          {
 261:                              r = "SRT with no SR: ";
 262:  
 263:                              foreach (int n in serviceRequestTypeWithNoServiceRequestIdList) r += n + ",";
 264:  
 265:                              r = r.Trim(',');
 266:                          }
 267:                          */
 268:   
 269:                          // below: this function will remove values that were not present in the reading
 270:                          if (serviceRequestTypeList.Count > 0)
 271:                          {
 272:                              foreach (Ia.Ngn.Cl.Model.ServiceRequestType srt in serviceRequestTypeList)
 273:                              {
 274:                                  if (!newServiceRequestTypeIdArryList.Contains(srt.Id))
 275:                                  {
 276:                                      serviceRequestType = (from srt2 in db.ServiceRequestTypes where srt2.Id == srt.Id select srt2).SingleOrDefault();
 277:   
 278:                                      db.ServiceRequestTypes.Remove(serviceRequestType);
 279:   
 280:                                      deletedItemCount++;
 281:                                  }
 282:                              }
 283:                          }
 284:   
 285:                          db.SaveChanges();
 286:   
 287:                          if (insertedItemCount != 0 || updatedItemCount != 0 || deletedItemCount != 0) isUpdated = true;
 288:                          else isUpdated = false;
 289:   
 290:                          result = "(" + readItemCount + "/" + existingItemCount + "/" + insertedItemCount + "," + updatedItemCount + "," + deletedItemCount + ") " + r;
 291:                      }
 292:                  }
 293:                  else
 294:                  {
 295:                      result = "(?/?/?: SQL in TableName is unmatched) ";
 296:                  }
 297:              }
 298:              else
 299:              {
 300:                  result = "(dataTable == null/?/?) ";
 301:              }
 302:          }
 303:   
 304:          ////////////////////////////////////////////////////////////////////////////
 305:   
 306:          /// <summary>
 307:          ///
 308:          /// </summary>
 309:          public static void UpdateForADateTimeRangeWithOutputDataTable(DataTable dataTable, Tuple<int, int> dateTime, out string result)
 310:          {
 311:              // below: the SQL statement should be within the dataTable.TableName variable
 312:              int readItemCount, existingItemCount, insertedItemCount, updatedItemCount, deletedItemCount;
 313:              int serviceRequestId, serviceRequestTypeId;
 314:              string sql, r;
 315:              ArrayList newServiceRequestTypeIdArryList;
 316:              DateTime startDateTime, endDateTime;
 317:              Match match;
 318:              Ia.Ngn.Cl.Model.ServiceRequestType serviceRequestType, newServiceRequestType;
 319:              List<Ia.Ngn.Cl.Model.ServiceRequestType> serviceRequestTypeList;
 320:   
 321:              readItemCount = existingItemCount = insertedItemCount = updatedItemCount = deletedItemCount = 0;
 322:              result = r = "";
 323:   
 324:              startDateTime = endDateTime = DateTime.MinValue;
 325:   
 326:              if (dataTable != null)
 327:              {
 328:                  sql = dataTable.TableName;
 329:   
 330:                  // select * from SRV_REQ_FIPER LEFT OUTER JOIN SRV_REQ_FIPER_TECH ON SRV_REQ_FIPER_TECH.SRV_REQ_ID = SRV_REQ_FIPER.SRV_REQ_ID where REQ_DATE >= '06/01/2007' and REQ_DATE < '07/01/2007'  order by REQ_DATE asc, SRV_REQ_FIPER.SRV_REQ_ID asc
 331:   
 332:                  match = Regex.Match(sql, @".+'(\d{2})\/(\d{2})\/(\d{4})'.+'(\d{2})\/(\d{2})\/(\d{4})'.+", RegexOptions.Singleline);
 333:                  //                             1        2        3        4          5        6
 334:   
 335:                  if (match.Success)
 336:                  {
 337:                      using (var db = new Ia.Ngn.Cl.Model.Ngn())
 338:                      {
 339:                          readItemCount = dataTable.Rows.Count;
 340:   
 341:                          //if (dataTable.Rows.Count > 0)
 342:                          //{
 343:                          startDateTime = DateTime.Parse(match.Groups[3].Value + "-" + match.Groups[2].Value + "-" + match.Groups[1].Value);
 344:                          endDateTime = DateTime.Parse(match.Groups[6].Value + "-" + match.Groups[5].Value + "-" + match.Groups[4].Value);
 345:   
 346:                          serviceRequestTypeList = Ia.Ngn.Cl.Model.Data.ServiceRequestType.ReadListThatHaveServiceRequestsWithinGivenDateRange(startDateTime, endDateTime);
 347:                          existingItemCount = serviceRequestTypeList.Count;
 348:   
 349:                          newServiceRequestTypeIdArryList = new ArrayList(dataTable.Rows.Count + 1);
 350:   
 351:                          foreach (DataRow dataRow in dataTable.Rows)
 352:                          {
 353:                              serviceRequestId = int.Parse(dataRow["SRV_REQ_ID"].ToString());
 354:                              serviceRequestTypeId = int.Parse(serviceRequestId.ToString() + dataRow["TECH_TYPE_ID"].ToString().PadLeft(2, '0'));
 355:   
 356:                              newServiceRequestType = new Ia.Ngn.Cl.Model.ServiceRequestType();
 357:   
 358:                              newServiceRequestType.Id = serviceRequestTypeId;
 359:   
 360:                              newServiceRequestType.ServiceRequest = (from sr in db.ServiceRequests where sr.Id == serviceRequestId select sr).SingleOrDefault();
 361:   
 362:                              // below: we will not add any type that does not have a service request
 363:                              if (newServiceRequestType.ServiceRequest != null)
 364:                              {
 365:                                  newServiceRequestType.TypeId = int.Parse(dataRow["TECH_TYPE_ID"].ToString());
 366:                                  newServiceRequestType.Value = dataRow["VAL"].ToString();
 367:   
 368:                                  FixCommonMistakesAndCheckValidityOfServiceRequestTypeRecords(ref newServiceRequestType);
 369:   
 370:                                  serviceRequestType = (from srt in serviceRequestTypeList where srt.Id == newServiceRequestType.Id select srt).SingleOrDefault();
 371:   
 372:                                  if (serviceRequestType == null)
 373:                                  {
 374:                                      newServiceRequestType.Created = newServiceRequestType.Updated = DateTime.UtcNow.AddHours(3);
 375:   
 376:                                      db.ServiceRequestTypes.Add(newServiceRequestType);
 377:   
 378:                                      insertedItemCount++;
 379:                                  }
 380:                                  else
 381:                                  {
 382:                                      // below: copy values from newServiceRequestType to serviceRequestType
 383:   
 384:                                      if (serviceRequestType.Update(newServiceRequestType))
 385:                                      {
 386:                                          db.ServiceRequestTypes.Attach(serviceRequestType);
 387:                                          db.Entry(serviceRequestType).State = System.Data.Entity.EntityState.Modified;
 388:   
 389:                                          updatedItemCount++;
 390:                                      }
 391:                                  }
 392:   
 393:                                  // below: this will enable the removal of SRT that don't have a valid SR
 394:                                  newServiceRequestTypeIdArryList.Add(serviceRequestTypeId);
 395:                              }
 396:                              else
 397:                              {
 398:                                  r += "newServiceRequestType.Id: " + newServiceRequestType.Id + " newServiceRequestType.ServiceRequest == null, ";
 399:                              }
 400:                          }
 401:   
 402:                          // below: this function will remove values that were not present in the reading
 403:                          if (serviceRequestTypeList.Count > 0)
 404:                          {
 405:                              foreach (Ia.Ngn.Cl.Model.ServiceRequestType srt in serviceRequestTypeList)
 406:                              {
 407:                                  if (!newServiceRequestTypeIdArryList.Contains(srt.Id))
 408:                                  {
 409:                                      serviceRequestType = (from srt2 in db.ServiceRequestTypes where srt2.Id == srt.Id select srt2).SingleOrDefault();
 410:   
 411:                                      db.ServiceRequestTypes.Remove(srt);
 412:   
 413:                                      deletedItemCount++;
 414:                                  }
 415:                              }
 416:                          }
 417:   
 418:                          db.SaveChanges();
 419:   
 420:                          result = "(" + readItemCount + "/" + existingItemCount + "/" + insertedItemCount + "," + updatedItemCount + "," + deletedItemCount + ") " + r;
 421:                          //}
 422:                          //else
 423:                          //{
 424:                          //    result = "(" + readItemCount + "/?/?) ";
 425:                          //}
 426:                      }
 427:                  }
 428:                  else
 429:                  {
 430:                      result = "(?/?/?: SQL in TableName is unmatched) ";
 431:                  }
 432:              }
 433:              else
 434:              {
 435:                  result = "(dataTable == null/?/?) ";
 436:              }
 437:          }
 438:   
 439:          ////////////////////////////////////////////////////////////////////////////    
 440:   
 441:          /// <summary>
 442:          ///
 443:          /// </summary>
 444:          private static void FixCommonMistakesAndCheckValidityOfServiceRequestTypeRecords(ref Ia.Ngn.Cl.Model.ServiceRequestType serviceRequestType)
 445:          {
 446:              // below: procedure to fix service request records from the common mistakes
 447:   
 448:              bool b;
 449:              int number;
 450:   
 451:              // below: convert 7 digit numbers to 8 digits
 452:              // <type id="11" name="dn" arabicName="dn" oracleFieldName="الرقم الجديد"/>
 453:              if (serviceRequestType.TypeId == 11)
 454:              {
 455:                  b = int.TryParse(serviceRequestType.Value.Trim(), out number);
 456:   
 457:                  if (b)
 458:                  {
 459:                      number = Ia.Ngn.Cl.Model.Business.Default.ChangeOldSevenDigitNumbersToEightDigitFormat(number);
 460:   
 461:                      if (Ia.Ngn.Cl.Model.Business.Service.NumberIsWithinAllowedDomainList(number))
 462:                      {
 463:                          serviceRequestType.Value = number.ToString();
 464:                      }
 465:                      else serviceRequestType.Value = null;
 466:                  }
 467:                  else serviceRequestType.Value = null;
 468:              }
 469:          }
 470:   
 471:          ////////////////////////////////////////////////////////////////////////////    
 472:          ////////////////////////////////////////////////////////////////////////////    
 473:      }
 474:   
 475:      ////////////////////////////////////////////////////////////////////////////
 476:      ////////////////////////////////////////////////////////////////////////////
 477:  }