Beispiel #1
0
        //按照员工ID加载员工奖惩纪录
        public void loadTransfer(string id)
        {
            if (string.IsNullOrEmpty(id))
            {
                if (hidID.Contains("id"))
                {
                    hidID.Remove("id");
                }
                FrmUtil.ClearData(this);
                onEdit(false);
            }
            else
            {
                IDao      dao = DaoFactory.GetDao("DaoBizTransfer");
                DataTable dt  = dao.SelectByPK(id);
                if (null != dt && dt.Rows.Count > 0)
                {
                    hidID["ID"] = id;
                    FrmUtil.FillData(dt, this); // 加载业务数据

                    onEdit(true);
                }
                else
                {
                    if (hidID.Contains("id"))
                    {
                        hidID.Remove("id");
                    }
                    FrmUtil.ClearData(this);
                    onEdit(false);
                }
            }
        }
Beispiel #2
0
 private void loadDeptInfo(string dept)
 {
     if (ASPxPageControl1.ActiveTabIndex == 0)
     {
         // 加载部门信息
         IDao      dao1 = DaoFactory.GetDao("DaoBasDept");
         DataTable dt1  = dao1.SelectByPK(dept);
         if (null != dt1)
         {
             FrmUtil.FillData(dt1, ASPxPageControl1);
         }
         else
         {
             FrmUtil.ClearData(ASPxPageControl1);
         }
     }
     else
     {
         // 加载部门员工信息
         IDao dao2 = DaoFactory.GetDao("DaoBasEmployee");
         dao2.Params["DeptCode"]  = dept;
         ASPxGridView1.DataSource = dao2.Select();
         ASPxGridView1.DataBind();
     }
 }
Beispiel #3
0
 //按照ID加载员工家庭信息
 public void loadFamily(string id)
 {
     if (string.IsNullOrEmpty(id))
     {
         if (hidID.Contains("id"))
         {
             hidID.Remove("id");
         }
         FrmUtil.ClearData(this);
         onEdit(false);
     }
     else
     {
         IDao      dao = DaoFactory.GetDao("DaoBizFamily");
         DataTable dt  = dao.SelectByPK(id);
         if (null != dt && dt.Rows.Count > 0)
         {
             hidID["ID"] = id;
             FrmUtil.FillData(dt, this); // 加载业务数据
             //FrmUtil.GetImage("Employee", code, ASPxBinaryImage1); // 加载照片
             onEdit(true);
         }
         else
         {
             if (hidID.Contains("id"))
             {
                 hidID.Remove("id");
             }
             FrmUtil.ClearData(this);
             onEdit(false);
         }
     }
 }
Beispiel #4
0
 private void clearInput()
 {
     if (hidID.Contains("ID"))
     {
         hidID.Remove("ID");
     }
     FrmUtil.ClearData(this);
     setReadOnly(false);
 }
Beispiel #5
0
        protected void ASPxCallbackPanel1_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
        {
            // 加载菜单信息
            DaoSysMenu dao = new DaoSysMenu();
            DataTable  dt  = dao.SelectByPK(e.Parameter);

            if (null != dt)
            {
                FrmUtil.FillData(dt, ASPxCallbackPanel1);
            }
            else
            {
                FrmUtil.ClearData(ASPxCallbackPanel1);
            }
        }
Beispiel #6
0
        /// <summary>
        /// 加载信息
        /// </summary>
        private void loadUserInfo(string username)
        {
            if (string.IsNullOrEmpty(username))
            {
                if (hidID.Contains("UserName"))
                {
                    hidID.Remove("UserName");
                }
                FrmUtil.ClearData(this);
                onEdit(false);
            }
            else
            {
                using (var context = ContextFactory.CreateContext <User>())
                {
                    var user = context.Set <User>().FirstOrDefault(u => u.UserName == username);

                    if (null != user)
                    {
                        hidID["UserName"] = username;

                        txtUserName.Text = user.UserName;
                        txtName.Text     = user.Name;
                        txtPassword.Text = user.Password;
                        txtMemo.Text     = user.Memo;

                        onEdit(true);
                    }
                    else
                    {
                        if (hidID.Contains("id"))
                        {
                            hidID.Remove("id");
                        }
                        FrmUtil.ClearData(this);
                        onEdit(false);
                    }
                }
            }
        }
Beispiel #7
0
 // 按员工编号,加载员工信息和员工照片
 public void loadEmployee(string code)
 {
     ASPxPageControl1.ActiveTabIndex = 0;
     if (string.IsNullOrEmpty(code))
     {
         if (hidCode.Contains("Code"))
         {
             hidCode.Remove("Code");
         }
         FrmUtil.ClearData(this);
         onEdit(false);
     }
     else
     {
         IDao      dao = DaoFactory.GetDao("DaoBasEmployee");
         DataTable dt  = dao.SelectByPK(code);
         if (null != dt && dt.Rows.Count > 0)
         {
             hidCode["Code"] = code;
             FrmUtil.CreateDirectory("~\\Images\\UpLoadImages", code); //创建员工照片文件夹
             FrmUtil.FillData(dt, this);                               // 加载业务数据
             FrmUtil.GetImage("Employee", code, ASPxBinaryImage1);     // 加载员工照片
             loadImageSlider(code);                                    //加载ImageSlider图片,逐个加载
             onEdit(true);
         }
         else
         {
             if (hidCode.Contains("Code"))
             {
                 hidCode.Remove("Code");
             }
             FrmUtil.ClearData(this);
             onEdit(false);
         }
     }
 }