Exemplo n.º 1
0
 public UsersDto PostLoginUser(UsersDto userDto)
 {
     var cn = new SqlConnection(GetConnection());
     var user = new UsersDto();
     try
     {
         cn.Open();
         string cmdText = "select um.UserId,um.UserName,um.MemberId,um.UserTypeId,mm.FirstName from Users um left join Members mm on mm.MemberId = um.MemberId left join Passwords pw on pw.UserId = um.UserId  Where um.UserName = '******' and pw.Password = '******'";
         var cmd = new SqlCommand(cmdText, cn);
         var dr = cmd.ExecuteReader();
         while (dr.Read())
         {
             user.UserName = Convert.ToString(dr["UserName"]);
             user.UserId = Convert.ToInt32(dr["UserId"]);
             user.UserTypeId = Convert.ToInt32(dr["UserTypeId"]);
             user.MemberId = dr.IsDBNull(2) ? 0 : Convert.ToInt32(dr["MemberId"]);
             user.MemberName = Convert.ToString(dr["FirstName"]);
         }
         cn.Close();
     }
     catch (Exception)
     {
         cn.Close();
     }
     return user;
 }
Exemplo n.º 2
0
 public UsersDto PostLoginUser(UsersDto userDto)
 {
     return _iUserHelper.PostLoginUser(userDto);
 }
Exemplo n.º 3
0
 public UsersDto PostLoginUser(UsersDto userDto)
 {
     return _iUserRepository.PostLoginUser(userDto);
 }