Example #1
0
 private void InitializeSession()
 {
     try
     {
         RateDynamicGridList = new CustomList <RateDynamicGrid>();
         CustomList <DataCaptureRate> DataCaptureRateList = manager.GetAllRate();
         String          id     = "";
         Int32           count  = 1;
         RateDynamicGrid newObj = new RateDynamicGrid();
         if (DataCaptureRateList.Count != 0)
         {
             id = DataCaptureRateList[0].DataCapRateRuleID;
         }
         if (DataCaptureRateList.Count != 0)
         {
             foreach (DataCaptureRate dCR in DataCaptureRateList)
             {
                 if (id != dCR.DataCapRateRuleID)
                 {
                     newObj.SetUnchanged();
                     RateDynamicGridList.Add(newObj);
                     newObj = new RateDynamicGrid();
                     count  = 1;
                     id     = dCR.DataCapRateRuleID;
                 }
                 if (count == 1)
                 {
                     newObj.RateKey1 = dCR.RateKey;
                     newObj.Key1     = dCR.Field;
                     newObj.Rate     = dCR.Rate;
                     newObj.RateID   = dCR.DataCapRateRuleID;
                 }
                 if (count == 2)
                 {
                     newObj.RateKey2 = dCR.RateKey;
                     newObj.Key2     = dCR.Field;
                     newObj.RateID   = dCR.DataCapRateRuleID;
                 }
                 if (count == 3)
                 {
                     newObj.RateKey3 = dCR.RateKey;
                     newObj.Key3     = dCR.Field;
                     newObj.RateID   = dCR.DataCapRateRuleID;
                 }
                 if (count == 4)
                 {
                     newObj.RateKey4 = dCR.RateKey;
                     newObj.Key4     = dCR.Field;
                     newObj.RateID   = dCR.DataCapRateRuleID;
                 }
                 if (count == 5)
                 {
                     newObj.RateKey5 = dCR.RateKey;
                     newObj.Key5     = dCR.Field;
                     newObj.RateID   = dCR.DataCapRateRuleID;
                 }
                 count++;
             }
             newObj.SetUnchanged();
             RateDynamicGridList.Add(newObj);
         }
     }
     catch (Exception ex)
     {
         throw (ex);
     }
 }