コード例 #1
0
        public override void DeleteByID(object id)
        {
            var dac = new MQUESTSYSDAC();

            using (TransactionScope trans = new TransactionScope())
            {
                base.DeleteByID(id);
                dac.DeleteRoleDetails(Convert.ToInt32(id));

                trans.Complete();
            }
        }
コード例 #2
0
        public void Create(RoleModel role, List <RoleDetailModel> roleDetails, string userName)
        {
            var dac = new MQUESTSYSDAC();

            role.CreatedBy   = role.ModifiedBy = userName;
            role.CreatedDate = role.ModifiedDate = DateTime.Now;

            using (TransactionScope trans = new TransactionScope())
            {
                dac.CreateRole(role);
                dac.CreateRoleDetails(role.ID, role.Details);

                trans.Complete();
            }
        }
コード例 #3
0
        public void Update(RoleModel role, List <RoleDetailModel> roleDetails, string userName)
        {
            var dac = new MQUESTSYSDAC();

            var extObj = RetrieveByID(role.ID);

            extObj.Name         = role.Name;
            extObj.IsActive     = role.IsActive;
            extObj.ModifiedBy   = userName;
            extObj.ModifiedDate = DateTime.Now;

            using (TransactionScope trans = new TransactionScope())
            {
                GetDAC().Update(extObj);
                dac.DeleteRoleDetails(role.ID);
                dac.CreateRoleDetails(role.ID, role.Details);

                trans.Complete();
            }
        }