Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            LoginUserID = currentAdmin.UserID;
            if (Request.QueryString["DepartmentID"] != null && Request.QueryString["DepartmentID"] != "undefined")
            {
                DepartmentID = Convert.ToInt32(Request.QueryString["DepartmentID"].ToString());
            }
            if (!IsPostBack)
            {
                this.btnSave.Text = "添加部门";
                if (DepartmentID > 0)
                {
                    DataSet ds = new DataSet();
                    ds = DepartmentInfobll.GetParentNameList(" r.DepartmentID= " + DepartmentID + " AND r.RecordIsDelete=0 ");
                    if (ds.Tables.Count > 0)
                    {
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            this.txtDepartmentName.Value      = ds.Tables[0].Rows[0]["ParentDepartmentInfoName"].ToString();
                            this.txtDepartmentNameChild.Value = ds.Tables[0].Rows[0]["DepartmentName"].ToString();
                            this.txtDepartmentID.Value        = ds.Tables[0].Rows[0]["ParentId"].ToString();
                            this.txtDepartmentCode.Value      = ds.Tables[0].Rows[0]["DepartmentCode"].ToString();
                            this.txtRemark.Value = ds.Tables[0].Rows[0]["Remark"].ToString();
                            if (ds.Tables[0].Rows[0]["IsReceiveBusiness"].ToString() == "True" || ds.Tables[0].Rows[0]["IsReceiveBusiness"].ToString() == "1")
                            {
                                this.RadioYes.Checked = true;
                                this.RadioNo.Checked  = false;
                            }
                            else
                            {
                                this.RadioYes.Checked = false;
                                this.RadioNo.Checked  = true;
                            }

                            this.btnSave.Text = "修改部门";
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        public void DepartmentCodeRepeat(HttpContext context)
        {
            int    b = 0;
            string DepartmentCode = "";
            int    DepartmentID   = 0;

            if (!string.IsNullOrEmpty(context.Request.QueryString["DepartmentCode"]))
            {
                DepartmentCode = context.Request.QueryString["DepartmentCode"];
            }
            if (!string.IsNullOrEmpty(context.Request.QueryString["DepartmentID"]))
            {
                DepartmentID = Convert.ToInt32(context.Request.QueryString["DepartmentID"]);
            }

            DataSet ds = new DataSet();

            ds = DepartmentInfobll.GetParentNameList("  r.DepartmentID<>" + DepartmentID + " and  r.DepartmentCode='" + DepartmentCode + "'  and r.RecordIsDelete=0 ");
            if (ds.Tables[0].Rows.Count > 0)
            {
                b = 1;
            }
            context.Response.Write(b);
        }