コード例 #1
0
 private void SetDepYearMonth()
 {
     XTHospital.COM.ReturnValue resoult = null;
     XTHospital.BLL.BLL_LoginUser bll = new XTHospital.BLL.BLL_LoginUser();
     try
     {
         resoult = bll.GetYearMonth();
     }
     catch
     {
         Response.Redirect("ErrorPage.aspx");
         return;
     }
     if (resoult.ErrorFlag)
     {
         //YearMonthHashTable.Clear();
         //for (int i = 0; i < resoult.ResultDataSet.Tables[0].Rows.Count; i++)
         //{
         //    YearMonthHashTable.Add(resoult.ResultDataSet.Tables[0].Rows[i]["SelectYearMonthValue"].ToString(), resoult.ResultDataSet.Tables[0].Rows[i]["SelectYearMonth"].ToString());
         //}
         this.drpYearMonth.DataSource = resoult.ResultDataSet.Tables[0];
         this.drpYearMonth.DataTextField = "SelectYearMonthValue";
         this.drpYearMonth.DataValueField = "SelectYearMonthValue";
         this.drpYearMonth.DataBind();
     }
     else
     {
         LiteralMsg.Text = resoult.ErrorID;
         LiteralMsg.DataBind();
     }
 }
コード例 #2
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string strUserID = txtLoginID.Text.Trim();
        string strMail = txtMail.Text.Trim();
        XTHospital.BLL.BLL_LoginUser bll = new XTHospital.BLL.BLL_LoginUser();
        XTHospital.COM.ReturnValue resoult = bll.GetEmployeePWD(strUserID);
        if (resoult.ErrorFlag)
        {
            if (resoult.Count < 1)
            {
                XTHospital.BLL.BLL_Log.AddLog("用户[" + strUserID + "]尝试找回密码失败,用户名不存在!", "1", Page.Request.UserHostAddress);//添加日志
                LiteralMsg.Text = "用户名不存在!";
                LiteralMsg.DataBind();
                return;
            }
            else
            {
                if (strMail == resoult.ResultDataSet.Tables[0].Rows[0]["EmployeeEmail"].ToString())
                {
                    bool blFlag = false;
                    string strPassWord = resoult.ResultDataSet.Tables[0].Rows[0]["EmployeePWD"].ToString();
                    string strUserName = resoult.ResultDataSet.Tables[0].Rows[0]["EmployeeName"].ToString();
                    string strMessage=string.Empty;
                    string strTitle="健康查询系统找回密码";
                    string strMailTo=resoult.ResultDataSet.Tables[0].Rows[0]["EmployeeEmail"].ToString().Trim();
                    string strMailBody = @"尊敬的阁下:
        您好!很高兴您能收到这封邮件。

        您最近忘记密码了吗?以后要牢记哦。

        您的账号为:" + strUserID + "   密码:" + strPassWord;
                    strMailBody += @"

        致
        敬

        子扬软件

        本邮件为系统自动发送,请勿回复。";
                    blFlag = XTHospital.COM.Method.SendMail1(strMailTo, strTitle, strMailBody, out strMessage);
                    if (blFlag)
                    {
                        XTHospital.BLL.BLL_Log.AddLog("用户[" + strUserName + "]使用了找回密码功能,将密码发送到了邮箱[" + strMailTo + "].", "1", Page.Request.UserHostAddress);//添加日志
                        LiteralMsg.Text = "密码已经发送到了您的邮箱!请查收";
                        LiteralMsg.DataBind();
                        return;
                    }
                    else
                    {
                        XTHospital.BLL.BLL_Log.AddLog("用户[" + strUserName + "]使用了找回密码功能,发送到邮箱[" + strMailTo + "]时失败." + strMessage, "1", Page.Request.UserHostAddress);//添加日志
                        LiteralMsg.Text = "发送到邮箱[" + strMailTo + "]时失败.";
                        LiteralMsg.DataBind();
                        return;
                    }
                }
                else
                {
                    XTHospital.BLL.BLL_Log.AddLog("用户[" + strUserID + "]尝试找回密码失败,所填邮箱不存在或不是其绑定的邮箱!", "1", Page.Request.UserHostAddress);//添加日志
                    LiteralMsg.Text = "输入的邮箱不存在或不是您当时绑定的邮箱!";
                    LiteralMsg.DataBind();
                    return;
                }
            }
        }
        else
        {
            LiteralMsg.Text = resoult.ErrorID;
            LiteralMsg.DataBind();
            return;
        }
    }
コード例 #3
0
ファイル: Service.cs プロジェクト: wgang10/XTHospatal
 public ReturnValue StatisticNums()
 {
     BLL_LoginUser bll = new BLL_LoginUser();
     return bll.StatisticNums();
 }
コード例 #4
0
ファイル: Service.cs プロジェクト: wgang10/XTHospatal
 public string[] ValidateUserNoYearMonth(string LoginUserID, string TerminalCD, string UserID, string userPWD)
 {
     string Message = string.Empty;
     string[] ReturnValue = { "", "", "" };
     BLL_LoginUser bll = new BLL_LoginUser();
     ReturnValue resoult = bll.GetUserPwd(UserID);
     if (resoult.ErrorFlag)
     {
         if (resoult.Count < 1)
         {
             ReturnValue[0] = "0";
             ReturnValue[1] = "用户名或密码错误!";
             ReturnValue[2] = "";
             return ReturnValue;
         }
         else
         {
             if (userPWD == resoult.ResultDataSet.Tables[0].Rows[0]["UserPwd"].ToString())
             {
                 ReturnValue[0] = "1";
                 ReturnValue[1] = "";
                 ReturnValue[2] = resoult.ResultDataSet.Tables[0].Rows[0]["UserType"].ToString();
                 return ReturnValue;
             }
             else
             {
                 ReturnValue[0] = "0";
                 ReturnValue[1] = "用户名或密码错误!";
                 ReturnValue[2] = "";
                 return ReturnValue;
             }
         }
     }
     else
     {
         ReturnValue[0] = "0";
         ReturnValue[1] = resoult.ErrorID;
         ReturnValue[2] = "";
         return ReturnValue;
     }
 }
コード例 #5
0
ファイル: Service.cs プロジェクト: wgang10/XTHospatal
 public ReturnValue GetYearMonth()
 {
     BLL_LoginUser bll = new BLL_LoginUser();
     return bll.GetYearMonth();
 }
コード例 #6
0
ファイル: Service.cs プロジェクト: wgang10/XTHospatal
 public string[] SetYearMonth(string LoginUserID, string TerminalCD, string YearMonth)
 {
     BLL_LoginUser bll = new BLL_LoginUser();
     string Message = string.Empty;
     string[] ReturnValue = { "", "", "" };
     ReturnValue resoultYearMonth = bll.SetYearMonth(LoginUserID, TerminalCD, YearMonth);
     if (!resoultYearMonth.ErrorFlag)
     {
         ReturnValue[0] = "0";
         ReturnValue[1] = resoultYearMonth.ErrorID;
         ReturnValue[2] = "";
         return ReturnValue;
     }
     else
     {
         ReturnValue[0] = "1";
         ReturnValue[1] = "";
         ReturnValue[2] = "";
         return ReturnValue;
     }
 }
コード例 #7
0
ファイル: Service.cs プロジェクト: wgang10/XTHospatal
 public ReturnValue GetUserList()
 {
     BLL_LoginUser bll = new BLL_LoginUser();
     return bll.GetList();
 }
コード例 #8
0
ファイル: Service.cs プロジェクト: wgang10/XTHospatal
 public ReturnValue GetEmployeePWD(string EmployeeGZID)
 {
     BLL_LoginUser bll = new BLL_LoginUser();
     return bll.GetEmployeePWD(EmployeeGZID);
 }
コード例 #9
0
ファイル: Service.cs プロジェクト: wgang10/XTHospatal
 public ReturnValue DeleteUser(string UserID)
 {
     BLL_LoginUser bll = new BLL_LoginUser();
     return bll.Delete(UserID);
 }
コード例 #10
0
ファイル: Service.cs プロジェクト: wgang10/XTHospatal
 public ReturnValue AddUser(LoginUser model)
 {
     BLL_LoginUser bll = new BLL_LoginUser();
     return bll.AddUpdate(model);
 }
コード例 #11
0
ファイル: MyLogin.aspx.cs プロジェクト: wgang10/XTHospatal
 protected void btnLogin_Click(object sender, EventArgs e)
 {
     try
     {
         LiteralMsg.Text = "";
         LiteralMsg.DataBind();
         if (this.txtValidateCode.Text.Trim().ToUpper() == Session["CheckCode"].ToString().ToUpper())
         {
             string strUserID = txtLoginID.Text.Trim();
             string strUserPWD = txtPWD.Text.Trim();
             string strEmployeeName = string.Empty;
             XTHospital.BLL.BLL_LoginUser bll = new XTHospital.BLL.BLL_LoginUser();
             XTHospital.COM.ReturnValue resoult = bll.GetEmployeePWD(strUserID);
             if (resoult.ErrorFlag)
             {
                 if (resoult.Count < 1)
                 {
                     XTHospital.BLL.BLL_Log.AddLog("查询用户[" + strUserID + "]尝试登录系统失败,用户名或密码错误!", "1", Page.Request.UserHostAddress);//添加日志
                     LiteralMsg.Text = "用户名或密码错误!";
                     LiteralMsg.DataBind();
                     return;
                 }
                 else
                 {
                     if (strUserPWD == resoult.ResultDataSet.Tables[0].Rows[0]["EmployeePWD"].ToString())
                     {
                         Session["LoginUserID"] = strUserID;
                         Session["LoginUserName"] = strEmployeeName;
                         strEmployeeName = resoult.ResultDataSet.Tables[0].Rows[0]["EmployeeName"].ToString().Trim();
                         Session["EmployeeID"] = resoult.ResultDataSet.Tables[0].Rows[0]["EmployeeID"].ToString().Trim();
                         Session["EmployeeMail"] = resoult.ResultDataSet.Tables[0].Rows[0]["EmployeeEmail"].ToString().Trim();
                         Session["EmployeePhone"] = resoult.ResultDataSet.Tables[0].Rows[0]["EmployeePhone"].ToString().Trim();
                         XTHospital.BLL.BLL_Log.AddLog("查询用户[" + strEmployeeName + "]登录了系统.", "1", Page.Request.UserHostAddress);//添加日志
                         Response.Redirect("XTHospitalDefault.aspx");
                     }
                     else
                     {
                         LiteralMsg.Text = "用户名或密码错误!";
                         LiteralMsg.DataBind();
                         return;
                     }
                 }
             }
             else
             {
                 LiteralMsg.Text = resoult.ErrorID;
                 LiteralMsg.DataBind();
                 return;
             }
         }
         else
         {
             LiteralMsg.Text = "验证码错误!";
             LiteralMsg.DataBind();
             return;
         }
     }
     catch(Exception ex)
     {
         LiteralMsg.Text = ex.Message;
         LiteralMsg.DataBind();
         return;
     }
 }