Beispiel #1
0
        public static string GetUnitU8Code(string UnitCode)
        {
            string text2;

            try
            {
                string text = "";
                if (UnitCode == "")
                {
                    return(text);
                }
                EntityData unitByCode = OBSDAO.GetUnitByCode(UnitCode);
                if (unitByCode.HasRecord())
                {
                    text = unitByCode.GetString("U8Code");
                }
                unitByCode.Dispose();
                text2 = text;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(text2);
        }
Beispiel #2
0
        public static string GetUnitSubjectSet(string unitCode, ref int isSelfAccount)
        {
            string text2;

            try
            {
                string     text       = "";
                EntityData unitByCode = OBSDAO.GetUnitByCode(unitCode);
                if (unitByCode.HasRecord())
                {
                    text          = unitByCode.GetString("SubjectSetCode");
                    isSelfAccount = unitByCode.GetInt("SelfAccount");
                }
                unitByCode.Dispose();
                text2 = text;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(text2);
        }
Beispiel #3
0
        public static string GetProjectSubjectSet(string projectCode, ref int isSelfAccount)
        {
            string text3;

            try
            {
                string     code       = SystemRule.GetProjectUnitCode(projectCode);
                string     text2      = "";
                EntityData unitByCode = OBSDAO.GetUnitByCode(code);
                if (unitByCode.HasRecord())
                {
                    text2         = unitByCode.GetString("SubjectSetCode");
                    isSelfAccount = unitByCode.GetInt("SelfAccount");
                }
                unitByCode.Dispose();
                text3 = text2;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(text3);
        }
Beispiel #4
0
        protected void btnDelete_ServerClick(object sender, System.EventArgs e)
        {
            string unitCode = Request["UnitCode"] + "";

            try
            {
                bool canDelete = true;
//				EntityData role = DAL.EntityDAO.SystemManageDAO.GetOBSRoleByUnitCode(unitCode);
//				if ( role.HasRecord() )
//					canDelete = false;
//				role.Dispose();

                EntityData childDepartment = DAL.EntityDAO.OBSDAO.GetOBSUnitByParent(unitCode);
                if (childDepartment.HasRecord())
                {
                    canDelete = false;
                }
                childDepartment.Dispose();

                if (!canDelete)
                {
                    Rms.Web.JavaScript.Alert(true, "这个部门下面设定有子部门和角色,不可删除 !");
                    return;
                }

                EntityData ds = OBSDAO.GetUnitByCode(unitCode);
                OBSDAO.DeleteUnit(ds);
                ds.Dispose();
                CloseWindow(true);
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
                Response.Write(Rms.Web.JavaScript.Alert(true, "删除出错"));
            }
        }