示例#1
0
文件: Login.aspx.cs 项目: whtec/lcss
 protected void btnLogin_ServerClick(object sender, EventArgs e)
 {
     LCSS.Model.T_Account oAccount = new LCSS.BLL.T_Account().GetLoginInfo(txtUserName.Value, DESEncrypt.Encrypt(txtPassword.Value.Trim()));
     if (oAccount == null)
     {
         //throw new Exception("用户名或密码错误");
         lblmsg.InnerText = "用户名或密码错误!";
         return;
     }
     LCSS.Model.LoginInfo oLoginInfo = new LCSS.Model.LoginInfo();
     oLoginInfo.Agent     = Request.UserAgent;
     oLoginInfo.HostName  = Request.UserHostName;
     oLoginInfo.IPAdr     = Request.UserHostAddress;
     oLoginInfo.LoginID   = oAccount.ACCT_LoginID;
     oLoginInfo.LoginTime = System.DateTime.Now.ToString();
     if (string.IsNullOrEmpty(oAccount.ACCT_US_Code))
     {
         oLoginInfo.OrgCode  = oAccount.ACCT_Org_Code;
         oLoginInfo.UserName = oAccount.ACCT_UserName;
     }
     else
     {
         LCSS.Model.Employees oEmployees = new LCSS.Model.Employees();
         oEmployees = new LCSS.BLL.Employees().GetModel(oAccount.ACCT_US_Code);
         if (oAccount == null)
         {
             //throw new Exception("用户名或密码错误");
             lblmsg.InnerText = "没有找到对应的员工!";
             return;
         }
         oLoginInfo.UserID   = oEmployees.Emp_Code;
         oLoginInfo.UserName = oEmployees.Emp_Name;
         oLoginInfo.OrgCode  = oEmployees.Emp_Org_Code;
     }
     oLoginInfo.OrgName = new LCSS.BLL.Organization().GetModel(oLoginInfo.OrgCode).Org_Name;
     Session[PageSessionName.LoginObject] = oLoginInfo;
     Response.Redirect("Default.aspx");
 }
示例#2
0
文件: Employees.cs 项目: whtec/lcss
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(LCSS.Model.Employees model)
 {
     return(dal.Update(model));
 }
示例#3
0
文件: Employees.cs 项目: whtec/lcss
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public long Add(LCSS.Model.Employees model)
 {
     return(dal.Add(model));
 }