Пример #1
0
        public JsonResult UnBlockedClientUsers(short id = 0, string checkeds = "")
        {
            bool result = false;

            try
            {
                if (id > 0)
                {
                    if (checkeds.Trim().ToLower() == "true")
                    {
                        checkeds = "1";
                    }
                    if (checkeds.Trim().ToLower() == "false")
                    {
                        checkeds = "0";
                    }
                    UnBlockedClientUsersViewModel model = new UnBlockedClientUsersViewModel();
                    model.UnBlockedBy     = Convert.ToInt16(Session["TeamMemberRowID"]);
                    model.UnBlockedDate   = DateTime.Now;
                    model.ClientUserRowID = id;
                    model.Status          = Convert.ToByte(checkeds);
                    if (model.UnBlockedBy > 0)
                    {
                        repoLogin.UnBlockedClientUser(model);
                        int Res = repoLogin.SaveChanges();
                        if (Res > 0)
                        {
                            result = true;
                            // Send_Mail_UnblockedPassword_Client
                        }
                    }
                    else
                    {
                        ViewBag.ErrorMsg = "Invalid Id!";
                    }
                }
                else
                {
                    ViewBag.ErrorMsg = "Invalid Id!";
                }
            }
            catch (Exception Ex)
            {
                ViewBag.ErrorMsg = Ex.Message;
                clsCommonMethods.ErrorLog(Server.MapPath("~\\ErrorLogs\\Logfiles"), Ex.Message, Ex.StackTrace);
            }

            return(Json(new { result }, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
 public void UnBlockedClientUser(UnBlockedClientUsersViewModel model)
 {
     try
     {
         if (model.ClientUserRowID != 0)
         {
             db.PQClientLogins.Single(b => b.ClientUserRowID == model.ClientUserRowID).UnBlockedBy   = model.UnBlockedBy;
             db.PQClientLogins.Single(b => b.ClientUserRowID == model.ClientUserRowID).UnBlockedDate = model.UnBlockedDate;
             db.PQClientLogins.Single(b => b.ClientUserRowID == model.ClientUserRowID).Status        = model.Status;
         }
         else
         {
             throw new Exception("Web User could not be blank!");
         }
     }
     catch (Exception)
     {
         throw;
     }
 }