Beispiel #1
0
 /// <summary>
 /// 登陸驗證
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void imgbtnLogin_Click(object sender, EventArgs e)
 {
     PersonModel model = new PersonModel();
     if (!string.IsNullOrEmpty(txtUserId.Text) && !string.IsNullOrEmpty(txtPassword.Text))
     {
         string personcode = this.txtUserId.Text;
         string password = this.txtPassword.Text;
         List<PersonModel> user = pBll.GetPersonUserId(personcode, password);
         // List<PersonModel> pList = pBll.GetPersonPassword(password);
         if (user == null||user.Count<1)
         {
             lblMessage.Text = Message.EmpNotExist;
         }
         else
         {
             model.Personcode = txtUserId.Text;
             model.LoginTime = DateTime.Now;
             model.Passwd = user[0].Passwd;
             Session[GlobalData.UserLoginId] = model.Personcode;
             Session[GlobalData.UserInfoSessionKey] = user[0];
             Response.Redirect("MainForm.aspx?");
         }
     }
     else
     {
         lblMessage.Text = Message.TextBoxNotNull;
     }
 }
Beispiel #2
0
 /// <summary>
 /// 修改密碼
 /// </summary>
 protected override void AjaxProcess()
 {
     bool blPro = false;
     int result = 0;
     if (!string.IsNullOrEmpty(Request.Form["newPassword"]))
     {
         logmodel.ProcessFlag = "update";
         string newpwd = Request.Form["newPassword"];
         string oldpwd = Request.Form["Password"];
         string userno = CurrentUserInfo.Personcode;
         result = bll.UpdateUserByKey(userno, oldpwd, newpwd, logmodel);
         blPro = true;
     }
     if (!string.IsNullOrEmpty(Request.Form["Mail"]))
     {
         logmodel.ProcessFlag = "update";
         PersonModel model = new PersonModel();
         model.Mail = Request.Form["Mail"];
         model.Tel = Request.Form["Tel"];
         model.Mobile = Request.Form["Phone"];
         model.Personcode = CurrentUserInfo.Personcode;
         if (bll.UpdateMailByKey(model, logmodel))
         {
             result = 1;
         }
         blPro = true;
     }
     if (blPro)
     {
         Response.Clear();
         Response.Write(result.ToString());
         Response.End();
     }
 }
Beispiel #3
0
        protected override void AjaxProcess()
        {
            bool flag = false;
            string noticeJson = null;
            int num = 0;
            PersonModel model = new PersonModel();
            if (!string.IsNullOrEmpty(Request.Form["Empno"]))
            {
                PersonBll bll = new PersonBll();
                string empno = Request.Form["Empno"];

                model.Personcode = empno;
                model.Num = bll.GetCount(model);
                DataTable dt = bll.GetEmployeeInfo(model.Personcode);
                if (dt != null && dt.Rows.Count != 0)
                {
                    model.Cname = dt.Rows[0]["localname"].ToString();
                }
                flag = true;
            }
            //if (!string.IsNullOrEmpty(Request.Form["Personcode"]))
            //{
            //    string empno = Request.Form["Personcode"];
            //    Session["personcode"] = empno;
            //}
            if (model != null)
            {
                noticeJson = JsSerializer.Serialize(model);
            }
            if (flag)
            {
                Response.Clear();
                Response.Write(noticeJson);
                Response.End();
            }
        }
Beispiel #4
0
 /// <summary>
 /// 綁定數據
 /// </summary>
 private void DataBind()
 {
     //txtPersoncode.ReadOnly = true;
     txtPersoncode.Attributes.Add("readonly", "true");
     //txtCname.ReadOnly = true;
     txtCname.Attributes.Add("readonly", "true");
     //txtCompanyId.ReadOnly = true;
     txtCompanyId.Attributes.Add("readonly", "true");
     //txtDepCode.ReadOnly = true;
     txtDepCode.Attributes.Add("readonly", "true");
     //txtRoleCode.ReadOnly = true;
     txtRoleCode.Attributes.Add("readonly", "true");
     //txtLanguage.ReadOnly = true;
     txtLanguage.Attributes.Add("readonly", "true");
     //txtDepLevel.ReadOnly = true;
     txtDepLevel.Attributes.Add("readonly", "true");
     //txtIfAdmin.ReadOnly = true;
     txtIfAdmin.Attributes.Add("readonly", "true");
     //txtTel.ReadOnly = true;
     txtTel.Attributes.Add("readonly", "true");
     //txtMail.ReadOnly = true;
     txtMail.Attributes.Add("readonly", "true");
     btnSave.Attributes.Add("disabled", "true");
     btnCancel.Attributes.Add("disabled", "true");
     PersonBll bll = new PersonBll();
     PersonModel model = new PersonModel();
     DataTable dt = bll.GetPerson(model, pager.CurrentPageIndex, pager.PageSize, out totalCount, base.SqlDep);
     pager.RecordCount = totalCount;
     dt_global = bll.GetPerson(model, base.SqlDep); ;
     this.UltraWebGridPerson.DataSource = dt;
     this.UltraWebGridPerson.DataBind();
     pager.TextAfterPageIndexBox = "/" + pager.PageCount.ToString();
 }
Beispiel #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Session["personcode"] = "";
            pager.CurrentPageIndex = 1;
            HiddenModuleCode.Value = Request.QueryString["ModuleCode"].ToString();
            //PageHelper.ButtonControls(base.FuncList, pnlShowPanel.Controls, base.FuncListModule);
            if (ClientMessage == null)
            {
                ClientMessage = new Dictionary<string, string>();
                ClientMessage.Add("DeleteConfirm", Message.DeleteConfirm);
                ClientMessage.Add("SaveConfim", Message.SaveConfim);
                ClientMessage.Add("DataExist", Message.DataExist);
                ClientMessage.Add("PersoncodeNotNull", Message.PersoncodeNotNull);
                ClientMessage.Add("CnameNotNull", Message.CnameNotNull);
                ClientMessage.Add("CompanyIdNotNull", Message.CompanyIdNotNull);
                ClientMessage.Add("RolesCodeNotNull", Message.RolesCodeNotNull);
                ClientMessage.Add("DepCodeNotNull", Message.DepCodeNotNull);
                ClientMessage.Add("LanguageNotNull", Message.LanguageNotNull);
                ClientMessage.Add("IfAdminNotNull", Message.IfAdminNotNull);
                ClientMessage.Add("AtLastOneChoose", Message.AtLastOneChoose);
            }
            string clientmsg = JsSerializer.Serialize(ClientMessage);
            Page.ClientScript.RegisterStartupScript(GetType(), "ClientMessage", "var Message=" + clientmsg + ";", true);
            if (!IsPostBack)
            {
                HiddenPersonCode.Value = CurrentUserInfo.Personcode;
                logmodel.ProcessOwner = CurrentUserInfo.Personcode;
                logmodel.TransactionType = Request.QueryString["ModuleCode"].ToString();
                logmodel.LevelNo = "2";
                logmodel.FromHost = Request.UserHostAddress;
                PersonBll bll = new PersonBll();
                PersonModel model = new PersonModel();
                DataTable tempTable = bll.GetPerson(model, pager.CurrentPageIndex, pager.PageSize, out totalCount, base.SqlDep);
                pager.RecordCount = totalCount;
                dt_global = bll.GetPerson(model, base.SqlDep);
                pager.TextAfterPageIndexBox = "/" + pager.PageCount.ToString();
                DataBind(tempTable);
                SetSelector(imgCompanyId, txtCompanyId, txtCompanyName, "CompanyId", Request.QueryString["ModuleCode"].ToString());
                SetSelector(imgRolCode, txtRoleCode, txtRolesName, "RoleCode", Request.QueryString["ModuleCode"].ToString());
                SetSelector(imgDepLevel, txtDepLevel, txtLevelName, "DepLevel", Request.QueryString["ModuleCode"].ToString());
                SetSelector(imgLanguage, txtLanguage, txtLanguageName, "Language", Request.QueryString["ModuleCode"].ToString());
                SetSelector(imgAdmini, txtIfAdmin, txtAdminName, "IfAdmin", Request.QueryString["ModuleCode"].ToString());
                SetSelector(imgDePCode, txtDepCode, txtDepName, "DepCode", Request.QueryString["ModuleCode"].ToString());

                SetSelector(imgUserChangePwd, txtUserChangePwd, txtUserChangePwdName, "UserChangePwd", Request.QueryString["ModuleCode"].ToString());
                SetSelector(imgUserStartPwd, txtUserStartPwd, txtUserStartPwdName, "UserStartPwd", Request.QueryString["ModuleCode"].ToString());
                SetSelector(imegSalaryLogonEnable, txtSalaryLogonEnable, txtSalaryLogonEnableName, "SalaryLogonEnable", Request.QueryString["ModuleCode"].ToString());
                SetSelector(imgIpControlFlag, txtIpControlFlag, txtIpControlFlagName, "IpControlFlag", Request.QueryString["ModuleCode"].ToString());
                SetSelector(imgEmpType, txtEmpType, txtEmpTypeName, "EmpType", Request.QueryString["ModuleCode"].ToString());
            }
        }
Beispiel #6
0
 protected void pager_PageChanged(object sender, EventArgs e)
 {
     if (hidOperate.Value == "condition")
     {
         PersonBll bll = new PersonBll();
         DataTable dt = bll.GetPerson(model_global, pager.CurrentPageIndex, pager.PageSize, out totalCount, base.SqlDep);
         pager.RecordCount = totalCount;
         dt_global = bll.GetPerson(model_global, base.SqlDep); ;
         DataBind(dt);
     }
     else
     {
         PersonBll bll = new PersonBll();
         PersonModel model = new PersonModel();
         DataTable dt = bll.GetPerson(model, pager.CurrentPageIndex, pager.PageSize, out totalCount, base.SqlDep);
         pager.RecordCount = totalCount;
         dt_global = bll.GetPerson(model, base.SqlDep); ;
         DataBind(dt);
     }
 }
Beispiel #7
0
 protected void btnQuery_Click(object sender, EventArgs e)
 {
     pager.CurrentPageIndex = 1;
     if (hidOperate.Value == "condition")
     {
         model_global = GetModel();
         PersonBll bll = new PersonBll();
         DataTable dt = bll.GetPerson(model_global, pager.CurrentPageIndex, pager.PageSize, out totalCount, base.SqlDep);
         pager.RecordCount = totalCount;
         dt_global = bll.GetPerson(model_global, base.SqlDep); ;
         DataBind(dt);
     }
 }