예제 #1
0
        public string UpdatePlanDefine(PlanDefine planDefine)
        {
            var           db  = Utils.GetDb();
            PlanDefineDac dac = new PlanDefineDac(db);

            db.BeginTransaction();
            try
            {
                dac.UpdatePlanDefine(planDefine);
                if (planDefine.PlanItemCustomization != null)
                {
                    if (dac.IsExistCustomizedModel(planDefine.ID))
                    {
                        dac.UpdateCustomizedModel(planDefine.PlanItemCustomization, planDefine.ID);
                    }
                    else
                    {
                        dac.SaveCustomizedModel(planDefine.PlanItemCustomization, planDefine.ID);
                    }
                }
                if (planDefine.OrgList != null && planDefine.OrgList.Count > 0 && planDefine.RoleList != null && planDefine.RoleList.Count > 0)
                {
                    dac.DeletePlanDefineScope(planDefine.ID);
                    dac.SavePlanDefineScope(planDefine);
                }
                db.Commit();
                return(planDefine.ID);
            }
            catch
            {
                db.Rollback();
                throw;
            }
        }
예제 #2
0
        public void DeletePlanDefine(string planDefineID)
        {
            var           db  = Utils.GetDb();
            PlanDefineDac dac = new PlanDefineDac(db);

            db.BeginTransaction();
            try
            {
                dac.DeletePlanDefine(planDefineID);
                dac.DeletePlanItemCustomization(planDefineID);
                dac.DeletePlanDefineScope(planDefineID);
                dac.DeletePlanDefineDynamic(planDefineID);
                db.Commit();
            }
            catch
            {
                db.Rollback();
                throw;
            }
        }
예제 #3
0
        public string SavePlanDefine(PlanDefine planDefine)
        {
            var           db  = Utils.GetDb();
            PlanDefineDac dac = new PlanDefineDac(db);

            db.BeginTransaction();
            try
            {
                string id = dac.SavePlanDefine(planDefine);
                if (planDefine.PlanItemCustomization != null)
                {
                    dac.SaveCustomizedModel(planDefine.PlanItemCustomization, id);
                }
                dac.SavePlanDefineScope(planDefine);
                db.Commit();
                return(id);
            }
            catch
            {
                db.Rollback();
                throw;
            }
        }