Esempio n. 1
0
 public ReturnValue ChangePassWord(Employee model)
 {
     XTHospital.COM.ReturnValue resoult = dalLoginUser.GetPWDByEmployeeID(model.EmployeeID);
     if (resoult.ErrorFlag)
     {
         if (resoult.Count < 1)
         {
             resoult.ErrorFlag = false;
             resoult.ErrorID = "用户不存在!";
             return resoult;
         }
         else
         {
             if (model.EmployeePWD == resoult.ResultDataSet.Tables[0].Rows[0]["EmployeePWD"].ToString())
             {
                 //修改密码
                 resoult=dalEmployee.ChangePassWord(model);
                 return resoult;
             }
             else
             {
                 resoult.ErrorFlag = false;
                 resoult.ErrorID = "原始密码错误!";
                 return resoult;
             }
         }
     }
     else
     {
         return resoult;
     }
 }
Esempio n. 2
0
 public ReturnValue AddUpdate(Employee model)
 {
     ReturnValue resoult = dalEmployee.Search(model.EmployeeID);
     if (!resoult.ErrorFlag)
     {
         return resoult;
     }
     if (resoult.Count > 0)
     {
         resoult = dalEmployee.Update(model);
         if (resoult.ErrorFlag)
         {
             BLL_Log.AddLog(model.UPDATER_ID + " 修改了用户 " + model.EmployeeName, "1", model.TERMINAL_CD);
         }
     }
     else
     {
         resoult = dalEmployee.Add(model);
         if (resoult.ErrorFlag)
         {
             BLL_Log.AddLog(model.UPDATER_ID + " 添加了用户 " + model.EmployeeName, "1", model.TERMINAL_CD);
         }
     }
     return resoult;
 }
 protected void btnSave_Click(object sender, EventArgs e)
 {
     if (txtNewPWD.Text.Trim() != txtConfirmNewPWD.Text.Trim())
     {
         LiteralMsg.Text = "修改密码和确认密码不一致!";
         LiteralMsg.DataBind();
         return;
     }
     else
     {
         XTHospital.BLL.BLL_Employee bll = new XTHospital.BLL.BLL_Employee();
         XTHospital.Model.Employee model = new XTHospital.Model.Employee();
         model.UPDATER_ID = Session["LoginUserID"].ToString();
         model.TERMINAL_CD="";
         model.EmployeePWD = txtOldPWD.Text.Trim();
         model.EmployeeNewPWD=txtConfirmNewPWD.Text.Trim();
         model.EmployeeEmail=txtMail.Text.Trim();
         model.EmployeePhone=txtEmployeePhone.Text.Trim();
         model.EmployeeID = Session["EmployeeID"].ToString();
         XTHospital.COM.ReturnValue resoult = bll.ChangePassWord(model);
         if (!resoult.ErrorFlag)
         {
             LiteralMsg.Text = resoult.ErrorID;
             LiteralMsg.DataBind();
             return;
         }
         else
         {
             LiteralMsg.Text = "修改成功!";
             Session["EmployeeMail"] = txtMail.Text.Trim(); ;
             Session["EmployeePhone"] = txtEmployeePhone.Text.Trim();
             LiteralMsg.DataBind();
             return;
         }
     }
 }
Esempio n. 4
0
 public ReturnValue Update(Employee model)
 {
     SqlParameter[] parametersUpdate = {
             new SqlParameter("@UPDATER_ID", SqlDbType.NVarChar,12),
             new SqlParameter("@TERMINAL_CD", SqlDbType.NVarChar,256),
             new SqlParameter("@EmployeeID", SqlDbType.NVarChar,18),
             new SqlParameter("@EmployeeName", SqlDbType.NVarChar,50),
             new SqlParameter("@EmployeeSex", SqlDbType.NVarChar,1),
             new SqlParameter("@EmployeeBirthday", SqlDbType.NVarChar,8),
             new SqlParameter("@EmployeeWHCD", SqlDbType.NVarChar,50),
             new SqlParameter("@EmployeeHF", SqlDbType.NVarChar,1),
             new SqlParameter("@EmployeeJG", SqlDbType.NVarChar,50),
             new SqlParameter("@EmployeeXJD", SqlDbType.NVarChar,200),
             new SqlParameter("@EmployeeBM", SqlDbType.NVarChar,200),
             new SqlParameter("@EmployeeDW", SqlDbType.NVarChar,200),
             new SqlParameter("@EmployeeJWBS", SqlDbType.NVarChar,1024)};
     parametersUpdate[0].Value = model.UPDATER_ID;
     parametersUpdate[1].Value = model.TERMINAL_CD;
     parametersUpdate[2].Value = model.EmployeeID;
     parametersUpdate[3].Value = model.EmployeeName;
     parametersUpdate[4].Value = model.EmployeeSex;
     parametersUpdate[5].Value = model.EmployeeBirthday;
     parametersUpdate[6].Value = model.EmployeeWHCD;
     parametersUpdate[7].Value = model.EmployeeHF;
     parametersUpdate[8].Value = model.EmployeeJG;
     parametersUpdate[9].Value = model.EmployeeXJD;
     parametersUpdate[10].Value = model.EmployeeBM;
     parametersUpdate[11].Value = model.EmployeeDW;
     parametersUpdate[12].Value = model.EmployeeJWBS;
     return SqlHelper.ExecuteSql(UpdateEmployee_SQL, parametersUpdate);
 }
Esempio n. 5
0
 public ReturnValue ChangePassWord(Employee model)
 {
     SqlParameter[] parametersUpdate = {
             new SqlParameter("@UPDATER_ID", SqlDbType.NVarChar,12),
             new SqlParameter("@TERMINAL_CD", SqlDbType.NVarChar),
             new SqlParameter("@EmployeePWD", SqlDbType.NVarChar,50),
             new SqlParameter("@EmployeeEmail", SqlDbType.NVarChar,50),
             new SqlParameter("@EmployeePhone", SqlDbType.NVarChar,50),
             new SqlParameter("@EmployeeID", SqlDbType.NVarChar,18)};
     parametersUpdate[0].Value = model.UPDATER_ID;
     parametersUpdate[1].Value = model.TERMINAL_CD;
     parametersUpdate[2].Value = model.EmployeeNewPWD;
     parametersUpdate[3].Value = model.EmployeeEmail;
     parametersUpdate[4].Value = model.EmployeePhone;
     parametersUpdate[5].Value = model.EmployeeID;
     return SqlHelper.ExecuteSql(UpdateEmployeePWD, parametersUpdate);
 }
Esempio n. 6
0
 public ReturnValue Update(Employee model)
 {
     OleDbParameter[] parametersUpdate = {
             new OleDbParameter("@UPDATER_ID", OleDbType.VarWChar,12),
             new OleDbParameter("@TERMINAL_CD", OleDbType.LongVarWChar),
             new OleDbParameter("@EmployeeName", OleDbType.VarWChar,50),
             new OleDbParameter("@EmployeeSex", OleDbType.VarWChar,1),
             new OleDbParameter("@EmployeeBirthday", OleDbType.VarWChar,8),
             new OleDbParameter("@EmployeeWHCD", OleDbType.VarWChar,50),
             new OleDbParameter("@EmployeeHF", OleDbType.VarWChar,1),
             new OleDbParameter("@EmployeeJG", OleDbType.VarWChar,50),
             new OleDbParameter("@EmployeeXJD", OleDbType.VarWChar,200),
             new OleDbParameter("@EmployeeBM", OleDbType.VarWChar,200),
             new OleDbParameter("@EmployeeDW", OleDbType.VarWChar,200),
             new OleDbParameter("@EmployeeJWBS", OleDbType.LongVarWChar),
             new OleDbParameter("@EmployeeGZID", OleDbType.VarWChar,8),
             new OleDbParameter("@EmployeePWD", OleDbType.VarWChar,50),
             new OleDbParameter("@EmployeeEmail", OleDbType.VarWChar,50),
             new OleDbParameter("@EmployeePhone", OleDbType.VarWChar,50),
             new OleDbParameter("@EmployeeID", OleDbType.VarWChar,18)};
     parametersUpdate[0].Value = model.UPDATER_ID;
     parametersUpdate[1].Value = model.TERMINAL_CD;
     parametersUpdate[2].Value = model.EmployeeName;
     parametersUpdate[3].Value = model.EmployeeSex;
     parametersUpdate[4].Value = model.EmployeeBirthday;
     parametersUpdate[5].Value = model.EmployeeWHCD;
     parametersUpdate[6].Value = model.EmployeeHF;
     parametersUpdate[7].Value = model.EmployeeJG;
     parametersUpdate[8].Value = model.EmployeeXJD;
     parametersUpdate[9].Value = model.EmployeeBM;
     parametersUpdate[10].Value = model.EmployeeDW;
     parametersUpdate[11].Value = model.EmployeeJWBS;
     parametersUpdate[12].Value = model.EmployeeGZID;
     parametersUpdate[13].Value = model.EmployeePWD;
     parametersUpdate[14].Value = model.EmployeeEmail;
     parametersUpdate[15].Value = model.EmployeePhone;
     parametersUpdate[16].Value = model.EmployeeID;
     return OleDbHelper.ExecuteSql(UpdateEmployee_SQL, parametersUpdate);
     /*
      Update Employee Set
     UPDATE_DATETIME=FORMAT(date(),'YYYYMMDD')+FORMAT(TIME(),'HHMMSS'),
     TRANS_STATE='2',
     UPDATER_ID='wangang',
     TERMINAL_CD='MICROSOF-CC2281@Administrator',
     EmployeeName='������',
     EmployeeSex='0',
     EmployeeBirthday='20090617',
     EmployeeWHCD='��ѧ',
     EmployeeHF='1',
     EmployeeJG='�Ϻ�',
     EmployeeXJD='��������������������������������������������������������',
     EmployeeBM='029',
     EmployeeDW='����Ժ����Ժ����Ժ����Ժ����Ժ����Ժ����Ժ����Ժ����Ժ����Ժ����Ժ����Ժ',
     EmployeeJWBS='һ������һ������һ������һ������һ������һ������һ������һ������һ������һ������һ������һ������һ������һ������һ������һ������һ������һ������һ������һ������һ������'
     EmployeeGZID='wan',
     EmployeePWD='123',
     EmployeeEmail='111111111111111111',
     EmployeePhone='345'
     Where EmployeeID='123'
      */
 }
Esempio n. 7
0
 public ReturnValue Add(Employee model)
 {
     OleDbParameter[] parametersAdd = {
             new OleDbParameter("@UPDATER_ID", OleDbType.VarWChar,12),
             new OleDbParameter("@TERMINAL_CD", OleDbType.LongVarWChar),
             new OleDbParameter("@EmployeeID", OleDbType.VarWChar,18),
             new OleDbParameter("@EmployeeName", OleDbType.VarWChar,50),
             new OleDbParameter("@EmployeeSex", OleDbType.VarWChar,1),
             new OleDbParameter("@EmployeeBirthday", OleDbType.VarWChar,8),
             new OleDbParameter("@EmployeeWHCD", OleDbType.VarWChar,50),
             new OleDbParameter("@EmployeeHF", OleDbType.VarWChar,1),
             new OleDbParameter("@EmployeeJG", OleDbType.VarWChar,50),
             new OleDbParameter("@EmployeeXJD", OleDbType.VarWChar,200),
             new OleDbParameter("@EmployeeBM", OleDbType.VarWChar,200),
             new OleDbParameter("@EmployeeDW", OleDbType.VarWChar,200),
             new OleDbParameter("@EmployeeJWBS", OleDbType.LongVarWChar),
             new OleDbParameter("@EmployeeGZID", OleDbType.VarWChar,8),
             new OleDbParameter("@EmployeePWD", OleDbType.VarWChar,50),
             new OleDbParameter("@EmployeeEmail", OleDbType.VarWChar,50),
             new OleDbParameter("@EmployeePhone", OleDbType.VarWChar,50)};
     parametersAdd[0].Value = model.UPDATER_ID;
     parametersAdd[1].Value = model.TERMINAL_CD;
     parametersAdd[2].Value = model.EmployeeID;
     parametersAdd[3].Value = model.EmployeeName;
     parametersAdd[4].Value = model.EmployeeSex;
     parametersAdd[5].Value = model.EmployeeBirthday;
     parametersAdd[6].Value = model.EmployeeWHCD;
     parametersAdd[7].Value = model.EmployeeHF;
     parametersAdd[8].Value = model.EmployeeJG;
     parametersAdd[9].Value = model.EmployeeXJD;
     parametersAdd[10].Value = model.EmployeeBM;
     parametersAdd[11].Value = model.EmployeeDW;
     parametersAdd[12].Value = model.EmployeeJWBS;
     parametersAdd[13].Value = model.EmployeeGZID;
     parametersAdd[14].Value = model.EmployeePWD;
     parametersAdd[15].Value = model.EmployeeEmail;
     parametersAdd[16].Value = model.EmployeePhone;
     return OleDbHelper.ExecuteSql(Add_SQL, parametersAdd);
 }