Exemplo n.º 1
0
        public IHttpActionResult Login(EmployeeLoginModelGet adminLoginModelGet)
        {
            DataRow dataRow = _employeeInfoDal.Login(adminLoginModelGet.AccountId, adminLoginModelGet.LoginPassword);
            EmployeeLoginModelResult adminLoginModelResult = null;

            if (dataRow != null)
            {
                adminLoginModelResult             = new EmployeeLoginModelResult();
                adminLoginModelResult.AccountId   = dataRow["AccountId"].ToString();
                adminLoginModelResult.Id          = Convert.ToInt32(dataRow["Id"]);
                adminLoginModelResult.Nickname    = dataRow["Nickname"].ToString();
                adminLoginModelResult.Phone       = dataRow["Phone"].ToString();
                adminLoginModelResult.PhoneAreaId = dataRow["PhoneAreaId"].ToString();
                adminLoginModelResult.State       = dataRow["State"].ToString();
                adminLoginModelResult.Type        = dataRow["Type"].ToString();
                adminLoginModelResult.Token       = ServerHelper.GetToken;
                WebCacheHelper.SetCache(adminLoginModelResult.Id + "_" + 0, adminLoginModelResult.Token);
            }
            return(Json(new ResultDataModel <EmployeeLoginModelResult> {
                Code = dataRow == null ? -1 : 0, Data = adminLoginModelResult
            }));
        }
Exemplo n.º 2
0
 /// <summary>
 /// 登录
 /// </summary>
 /// <param name="ENo">员工编号</param>
 /// <param name="Rpassword">密码</param>
 /// <returns></returns>
 public static LoginResult Login(string ENo, string Rpassword)
 {
     return(EmployeeInfoDal.Login(ENo, Rpassword));
 }