示例#1
0
文件: ManDept.cs 项目: radtek/dms
        private void tsbAddChild_Click(object sender, EventArgs e)
        {
            try
            {
                if (!String.IsNullOrEmpty(tvDept.SelectedValue.ToString()))
                {
                    OnInitData();
                    CtrlHelper.EnableCtrls(allCtrls);
                    CtrlHelper.DisableCtrls(newCtrls);

                    SysDept sd = SqlBaseProvider.GetSysDept(tvDept.SelectedValue.ToString());
                    CtrlHelper.SelectDropDownList(ddlCoID, sd.CoID);
                    txtDeptPID.Text = sd.DeptID;
                    fState          = FormState.New;

                    tsbSave.Visible   = true;
                    tsbCancel.Visible = true;
                }
                else
                {
                    Global.ShowSysInfo("请选择需要增加同级部门的相关部门!");
                }
            }
            catch (Exception ex)
            {
                Global.ShowSysError(ex);
            }
        }
示例#2
0
文件: EditProject.cs 项目: radtek/dms
        protected override void OnInitData()
        {
            base.OnInitData();
            try
            {
                if (String.IsNullOrEmpty(id))
                {
                    id = String.Empty;
                    txtProjectCode.Text = String.Empty;
                    txtProjectName.Text = String.Empty;
                    txtProjectDesc.Text = String.Empty;
                    txtWorkDate.Text    = String.Empty;
                    CtrlHelper.SelectDropDownList(ddlProjectType, DropAddFlag.Select.ToString());
                    CtrlHelper.SelectDropDownList(ddlProjectStatus, DropAddFlag.Select.ToString());
                    CtrlHelper.SelectDropDownList(ddlProjectManager, DropAddFlag.Select.ToString());
                    CtrlHelper.SelectDropDownList(ddlWorkUnit, DropAddFlag.Select.ToString());
                }
                else
                {
                    BusProject item = SqlBaseProvider.GetBusProject(id);

                    if (String.IsNullOrEmpty(item.ProjectID))
                    {
                        throw new Exception("未找到编号为[" + id + "]的员工信息!");
                    }

                    id = item.ProjectID;
                    txtProjectCode.Text = item.ProjectCode;
                    txtProjectName.Text = item.ProjectName;
                    txtWorkDate.Text    = item.WorkDate.ToString();
                    txtProjectDesc.Text = item.ProjectDesc;

                    CtrlHelper.SelectDropDownList(ddlProjectManager, item.ProjectManager.ToString());
                    CtrlHelper.SelectDropDownList(ddlProjectType, item.ProjectType.ToString());
                    CtrlHelper.SelectDropDownList(ddlProjectStatus, item.ProjectStatus.ToString());
                    CtrlHelper.SelectDropDownList(ddlWorkUnit, item.WorkUnit.ToString());

                    int mAuth = Program.ManInfo.Auths.FindAuthByCode(this.mCode);


                    if (!CoreCtrls.CheckAuth(mAuth, AuthType.Edit))
                    {
                        this.OnDisplayAllCtrls(false);
                        tsbCancel.Visible = false;
                        tsbSave.Visible   = false;
                        tsbEdit.Visible   = false;
                        this.fState       = FormState.Detail;
                    }
                    else
                    {
                        this.OnDisplayEditCtrls(false);
                        this.fState = FormState.Edit;
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#3
0
文件: ManCompany.cs 项目: radtek/dms
        protected override void OnInitData()
        {
            OnBindData(NavType.None);

            txtCoAddress.Text = String.Empty;
            txtCoEMail.Text   = String.Empty;
            txtCoFax.Text     = String.Empty;
            txtCoID.Text      = String.Empty;
            txtCoMan.CodeText = String.Empty;
            txtCoMan.NameText = String.Empty;
            txtCoName.Text    = String.Empty;
            txtCoOrder.Text   = String.Empty;
            txtCoPost.Text    = String.Empty;
            txtCoTele.Text    = String.Empty;
            CtrlHelper.SelectDropDownList(ddlCoStatus, DropAddFlag.Select.ToString());
            base.OnInitData();
        }
示例#4
0
文件: ManDept.cs 项目: radtek/dms
        protected void OnInitData()
        {
            txtDeptAddress.Text = String.Empty;
            txtDeptEMail.Text   = String.Empty;
            txtDeptFax.Text     = String.Empty;
            txtDeptID.Text      = String.Empty;
            txtDeptMan.Text     = String.Empty;
            txtDeptName.Text    = String.Empty;
            txtDeptPID.Text     = String.Empty;
            txtDeptPost.Text    = String.Empty;
            txtDeptTele.Text    = String.Empty;
            txtSortOrder.Text   = String.Empty;
            txtDeptShort.Text   = String.Empty;

            CtrlHelper.SelectDropDownList(ddlCoID, DropAddFlag.Select.ToString());
            CtrlHelper.SelectDropDownList(ddlDeptType, DropAddFlag.Select.ToString());
            CtrlHelper.SelectDropDownList(ddlDeptLevel, DropAddFlag.Select.ToString());
            CtrlHelper.SelectDropDownList(ddlDeptStatus, DropAddFlag.Select.ToString());
        }
示例#5
0
文件: ManCompany.cs 项目: radtek/dms
        protected override bool OnLoadData(bool isLoad)
        {
            if ((etcMain.SelectedIndex == 1) && (String.IsNullOrEmpty(txtCoID.Text)))
            {
                MessageBox.Show("请返回列表选择需要进行修改的数据!", PublicConsts.PC_Tip);
                return(false);
            }

            if (dgvList.SelectedRows.Count != 1)
            {
                return(false);
            }

            try
            {
                txtCoID.Text = dgvList.SelectedRows[0].Cells["Co_ID"].Value.ToString();

                SysCompany sc = SqlBaseProvider.GetSysCompany(txtCoID.Text);

                txtCoName.Text    = sc.CoName;
                txtCoAddress.Text = sc.CoAddress;
                txtCoFax.Text     = sc.CoFax;
                txtCoTele.Text    = sc.CoTele;
                txtCoFax.Text     = sc.CoFax;
                txtCoEMail.Text   = sc.CoEMail;
                txtCoOrder.Text   = sc.SortOrder.ToString();
                txtCoPost.Text    = sc.CoPost;
                txtCoMan.CodeText = sc.CoMan;

                if (!String.IsNullOrEmpty(txtCoMan.CodeText))
                {
                    txtCoMan.NameText = SqlBaseProvider.GetManName(txtCoMan.CodeText);
                }

                CtrlHelper.SelectDropDownList(ddlCoStatus, sc.CoStatus.ToString());
            }
            catch (Exception ex)
            {
                Global.ShowSysError(ex);
            }

            return(true);
        }
示例#6
0
文件: ManDept.cs 项目: radtek/dms
        protected void OnLoadData()
        {
            try
            {
                SysDept sd = SqlBaseProvider.GetSysDept(tvDept.SelectedValue.ToString());

                txtDeptID.Text      = sd.DeptID;
                txtDeptPID.Text     = sd.DeptPID;
                txtDeptAddress.Text = sd.DeptAddress;
                txtDeptName.Text    = sd.DeptName;
                if (!String.IsNullOrEmpty(sd.DeptMan))
                {
                    txtDeptMan.CodeText = sd.DeptMan;
                    SysMan sm = SqlBaseProvider.GetSysMan(sd.DeptMan);
                    txtDeptMan.NameText = sm.ManName;
                }
                else
                {
                    txtDeptMan.CodeText = String.Empty;
                    txtDeptMan.NameText = String.Empty;
                }
                txtDeptEMail.Text = sd.DeptEMail;
                txtDeptFax.Text   = sd.DeptFax;
                txtDeptPost.Text  = sd.DeptPost;
                txtDeptTele.Text  = sd.DeptTele;
                txtSortOrder.Text = sd.SortOrder.ToString();
                txtDeptShort.Text = sd.DeptShort;

                CtrlHelper.SelectDropDownList(ddlCoID, sd.CoID);
                CtrlHelper.SelectDropDownList(ddlDeptType, sd.DeptType.ToString());
                CtrlHelper.SelectDropDownList(ddlDeptStatus, sd.DeptStatus.ToString());
                CtrlHelper.SelectDropDownList(ddlDeptLevel, sd.DeptLevel.ToString());
            }
            catch (Exception ex)
            {
                Global.ShowSysError(ex);
            }
        }
示例#7
0
        protected override void OnInitData()
        {
            base.OnInitData();

            clNav.Items.Clear();
            clMenu.Items.Clear();
            clAuth.Items.Clear();

            try
            {
                if (id == 0)
                {
                    menudt = SqlBaseProvider.GetRoleMenu();
                    navdt  = SqlBaseProvider.GetRoleNav();
                }
                else
                {
                    menudt = SqlBaseProvider.GetRoleMenu(id);
                    navdt  = SqlBaseProvider.GetRoleNav(id);

                    SysRole sr = SqlBaseProvider.GetSysRole(id);

                    if (sr.RoleID == 0)
                    {
                        throw new Exception("未找到编号为[" + id.ToString() + "]的角色信息!");
                    }

                    txtRoleName.Text = sr.RoleName;
                    txtRoleDesc.Text = sr.RoleDesc;
                    CtrlHelper.SelectDropDownList(ddlData, sr.AuthBound.ToString());
                }

                authdt = CoreCtrls.GetPublicProcedure("P_Get_MenuAuth");

                int i = 0;

                foreach (DataRow menudr in menudt.Rows)
                {
                    clMenu.Items.Add(menudr["M_Name"]);
                    if (Convert.ToBoolean(menudr["Is_Select"]))
                    {
                        clMenu.SetItemCheckState(clMenu.Items.Count - 1, CheckState.Checked);
                    }
                    else
                    {
                        clMenu.SetItemCheckState(clMenu.Items.Count - 1, CheckState.Unchecked);
                    }

                    i++;
                }

                i = 0;

                foreach (DataRow navdr in navdt.Rows)
                {
                    clNav.Items.Add(navdr["Rib_Btn_Name"]);
                    if (Convert.ToBoolean(navdr["Is_Select"]))
                    {
                        clNav.SetItemCheckState(clNav.Items.Count - 1, CheckState.Checked);
                    }
                    else
                    {
                        clNav.SetItemCheckState(clNav.Items.Count - 1, CheckState.Unchecked);
                    }

                    i++;
                }

                this.fState = FormState.Edit;
            }
            catch (Exception ex)
            {
                Global.ShowSysError(ex);
                this.OnDisplayAllCtrls(false);
                tsbCancel.Visible = false;
                tsbSave.Visible   = false;
                tsbEdit.Visible   = false;
                fState            = FormState.Detail;
            }
        }
示例#8
0
文件: EditMan.cs 项目: radtek/dms
        protected override void OnInitData()
        {
            base.OnInitData();

            try
            {
                Global.EnableComboxTree(ectDept);

                if (String.IsNullOrEmpty(id))
                {
                    txtManID.Text   = String.Empty;
                    txtManName.Text = String.Empty;
                    txtManTele.Text = String.Empty;
                    CtrlHelper.SelectDropDownList(ddlManLevel, DropAddFlag.Select.ToString());
                    CtrlHelper.SelectDropDownList(ddlManStatus, DropAddFlag.Select.ToString());
                    CtrlHelper.SelectDropDownList(ddlManTitle, DropAddFlag.Select.ToString());
                    CtrlHelper.SelectDropDownList(ddlManType, DropAddFlag.Select.ToString());

                    if (Program.ManInfo.Man.ManLevel >= ml)
                    {
                        ectDept.SelectValue = Program.ManInfo.Man.DeptID;
                    }
                    else
                    {
                        ectDept.Text = String.Empty;
                    }
                    this.fState = FormState.Edit;
                }
                else
                {
                    SysMan item = SqlBaseProvider.GetSysMan(id);

                    if (String.IsNullOrEmpty(item.ManID))
                    {
                        throw new Exception("未找到编号为[" + id + "]的员工信息!");
                    }

                    txtManID.Text   = item.ManID;
                    txtManName.Text = item.ManName;
                    txtManTele.Text = item.ManTele;

                    CtrlHelper.SelectDropDownList(ddlManLevel, item.ManLevel.ToString());
                    CtrlHelper.SelectDropDownList(ddlManStatus, item.ManStatus.ToString());
                    CtrlHelper.SelectDropDownList(ddlManTitle, item.ManTitle.ToString());
                    CtrlHelper.SelectDropDownList(ddlManType, item.ManType.ToString());
                    ectDept.SelectValue = item.DeptID;

                    int mAuth = Program.ManInfo.Auths.FindAuthByCode(this.mCode);


                    if (!CoreCtrls.CheckAuth(mAuth, AuthType.Edit))
                    {
                        this.OnDisplayAllCtrls(false);
                        Global.DisableComboxTree(ectDept);
                        tsbCancel.Visible = false;
                        tsbSave.Visible   = false;
                        tsbEdit.Visible   = false;
                        this.fState       = FormState.Detail;
                    }
                    else
                    {
                        this.OnDisplayEditCtrls(false);
                        this.fState = FormState.Edit;
                    }
                }

                if (Program.ManInfo.Man.ManLevel >= ml)
                {
                    Global.DisableComboxTree(ectDept);
                }
            }
            catch (Exception ex)
            {
                Global.ShowSysError(ex);
                this.OnDisplayAllCtrls(false);
                Global.DisableComboxTree(ectDept);
                tsbCancel.Visible = false;
                tsbSave.Visible   = false;
                tsbEdit.Visible   = false;
                this.fState       = FormState.Detail;
            }
        }