Example #1
0
 public string Get(string User_id, string password)
 {
     //string result ="";
     try
     {
         var res = db.sp_Login(User_id, password).SingleOrDefault();
         if (res == null)
         {
             var id = db.UserAccounts.Where(x => x.User_Id == User_id).SingleOrDefault();
             if (id == null)
             {
                 return("No Account found with requested UserID");
             }
             else
             {
                 var data = db.UserAccounts.Where(x => x.User_Id == User_id && x.Acc_Status == "Inactive").SingleOrDefault();
                 if (data == null)
                 {
                     return("Invalid Credentials");
                 }
                 else
                 {
                     //if (data.Acc_Status == "Inactive")
                     return("Your account has been locked. Kindly reset your password for reactivation");
                 }
             }
         }
         else
         {
             return(res.Acc_No.ToString());
         }
     }
     catch (Exception e)
     {
         throw e;
     }
     //Console.Write(result);
     //return result;
 }