Пример #1
0
    private void DisplayDepartmentData()
    {
        if (c.qsAct == ConfigFormAction.edit)
        {
            DepartmentForBackend dept = empAuth.GetDepartmentData(c.qsId);

            if (dept != null)
            {
                txtSortNo.Text   = dept.SortNo.ToString();
                txtDeptName.Text = dept.DeptName;

                //modification info
                ltrPostAccount.Text = dept.PostAccount;
                ltrPostDate.Text    = string.Format("{0:yyyy-MM-dd HH:mm:ss}", dept.PostDate);

                if (dept.MdfDate.HasValue)
                {
                    ltrMdfAccount.Text = dept.MdfAccount;
                    ltrMdfDate.Text    = string.Format("{0:yyyy-MM-dd HH:mm:ss}", dept.MdfDate);
                }

                btnSave.Visible = true;
            }
        }
        else if (c.qsAct == ConfigFormAction.add)
        {
            int newSortNo = empAuth.GetDepartmentMaxSortNo() + 10;
            txtSortNo.Text = newSortNo.ToString();

            btnSave.Visible = true;
        }
    }