Example #1
0
        //private bool IsPaymentDetailsExists() {
        //  IEnumerable<PaymentReceiptDetails> resultList = (IList<PaymentReceiptDetails>) Session["PaymentDetails"];
        //  return resultList != null && resultList.Count() > 0;
        //}

        protected override void SaveChildEntities(string[] childEntityList, Cycle entity)
        {
            foreach (string ChildEntity in childEntityList)
            {
                switch (ChildEntity)
                {
                    #region /* Case Statements - All child grids */
                case "CycleDetails":
                    if (Session[ChildEntity] != null)
                    {
                        CycleDetailsLibrary        library    = new CycleDetailsLibrary(ConfigurationHelper.GetsmARTDBContextConnectionString());
                        IEnumerable <CycleDetails> resultList = (IList <CycleDetails>)Session[ChildEntity];
                        foreach (CycleDetails cycleDetails in resultList)
                        {
                            cycleDetails.Cycle = new Cycle {
                                ID = entity.ID
                            };
                            cycleDetails.Date = entity.Start_Date;
                            library.Add(cycleDetails);
                        }
                    }
                    break;
                    #endregion
                }
            }
        }
Example #2
0
 protected override void DeleteChildEntities(string[] childEntityList, string parentID)
 {
     foreach (string ChildEntity in childEntityList)
     {
         switch (ChildEntity)
         {
             #region /* Case Statements - All child grids */
         case "CycleDetails":
             if (Convert.ToInt32(parentID) > 0)
             {
                 CycleDetailsLibrary        library    = new CycleDetailsLibrary(ConfigurationHelper.GetsmARTDBContextConnectionString());
                 IEnumerable <CycleDetails> resultList = library.GetAllByParentID(Convert.ToInt32(parentID), new string[] { "Item", "Purchase_ID" });
                 foreach (CycleDetails cycleDetails in resultList)
                 {
                     library.Delete(cycleDetails.ID.ToString());
                 }
             }
             break;
             #endregion
         }
     }
 }