Пример #1
0
        public int UpdateForm27PeriodType(Form27PeriodTypeDTO Form27CPeriodTypeDetails)
        {
            form27cperiodtype form27cperiodtypeEntity = new form27cperiodtype();
            int form27cPeriodType_Id;
            using (TransactionScope transactionScope = new TransactionScope())
            {
                AutoMapper.Mapper.Map(Form27CPeriodTypeDetails, form27cperiodtypeEntity);
                ESalesUnityContainer.Container.Resolve<IGenericRepository<form27cperiodtype>>().Update(form27cperiodtypeEntity);
                form27cPeriodType_Id = Form27CPeriodTypeDetails.form27cPeriodType_Id;

                transactionScope.Complete();
            }
            return form27cPeriodType_Id;
        }
Пример #2
0
        public int SaveForm27PeriodType(Form27PeriodTypeDTO form27CPeriodType)
        {
            form27cperiodtype form27CPerioTypeEntity = new form27cperiodtype();

            using (TransactionScope transactionScope = new TransactionScope())
            {
                AutoMapper.Mapper.Map(form27CPeriodType, form27CPerioTypeEntity);
                if (form27CPeriodType.form27cPeriodType_Id == 0)
                {
                    ESalesUnityContainer.Container.Resolve<IGenericRepository<form27cperiodtype>>().Save(form27CPerioTypeEntity);
                }
                transactionScope.Complete();
            }
            return form27CPerioTypeEntity.form27cPeriodType_Id;

        }