/// <summary>
        /// Save and Update AmeBlock
        /// </summary>
        /// <param name="ameBlockDetail"></param>
        /// <returns></returns>
        public int SaveAndUpdateAmeBlock(AmeBlockDTO ameBlockDetail)
        {
            ameblock ameblockEntity = new ameblock();
            AutoMapper.Mapper.Map(ameBlockDetail, ameblockEntity);

            if (ameBlockDetail.Blocks_Id > 0)
            {
                ESalesUnityContainer.Container.Resolve<IGenericRepository<ameblock>>().Update(ameblockEntity);
            }
            else
            {
                ESalesUnityContainer.Container.Resolve<IGenericRepository<ameblock>>().Save(ameblockEntity);
            }
            return ameblockEntity.Blocks_Id;
        }
Example #2
0
     private void Fixupameblock(ameblock previousValue)
     {
         if (previousValue != null && previousValue.customers.Contains(this))
         {
             previousValue.customers.Remove(this);
         }
 
         if (ameblock != null)
         {
             if (!ameblock.customers.Contains(this))
             {
                 ameblock.customers.Add(this);
             }
             if (Cust_AMEBlockId != ameblock.Blocks_Id)
             {
                 Cust_AMEBlockId = ameblock.Blocks_Id;
             }
         }
     }