public JsonResult setPassword(string email, string Password)
        {
            BAL_User obj  = new BAL_User();
            var      data = obj.SetPassword(email, Password);

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
Example #2
0
        public void LoadData(string packageId)
        {
            BAL_User packageDetails = new BAL_User();

            gdvStaffUser.DataSource = packageDetails.BALGetPackagesDetails(packageId);
            gdvStaffUser.DataBind();
        }
Example #3
0
        /// <summary>
        /// Function to Delete user details
        /// </summary>
        /// <param name="UserID"></param>
        /// <returns></returns>
        public Response <User> Delete(int UserID)
        {
            try
            {
                var res = BAL_User.RemoveUserAccount(UserID);
                if (res > 0)
                {
                    return new Response <User> {
                               Status = true, MessageType = MessageTypes.Success, Message = DisplayMessages.RemoveUser_Success
                    }
                }
                ;
                else
                {
                    return new Response <User> {
                               Status = false, MessageType = MessageTypes.Failure, Message = DisplayMessages.RemoveUser_Failure
                    }
                };
            }
            catch (SqlException ex)
            {
                if (ex.Errors.Count > 0)
                {
                    switch (ex.Errors[0].Number)
                    {
                    case 547:     // Foreign Key violation
                        return(new Response <User> {
                            Status = false, MessageType = MessageTypes.ForeignKeyIssue, Message = DisplayMessages.RemoveUser_ForeignKeyIssue
                        });

                    default:
                        return(new Response <User> {
                            Status = false, MessageType = MessageTypes.Exception, Message = ex.Message
                        });
                    }
                }
                else
                {
                    return new Response <User> {
                               Status = false, MessageType = MessageTypes.Exception, Message = ex.Message
                    }
                };
            }
            catch (Exception ex)
            {
                return(new Response <User> {
                    Status = false, MessageType = MessageTypes.Exception, Message = ex.Message
                });
            }
        }
        public JsonResult ForgetPassword(string email)
        {
            bool     result = false;
            BAL_User obj    = new BAL_User();
            var      data   = obj.passwordReset(email);

            if (data)
            {
                result = true;
                //return RedirectToAction("index", "login");
            }
            //return View();
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Example #5
0
 /// <summary>
 /// Function to get the list of all users
 /// </summary>
 /// <returns></returns>
 public Response <disUser> Get()
 {
     try
     {
         return(new Response <disUser> {
             Status = true, DataList = BAL_User.GetAllUserAccounts() ?? new List <disUser>()
         });
     }
     catch (Exception ex)
     {
         return(new Response <disUser> {
             Status = false, MessageType = MessageTypes.Exception, Message = ex.Message
         });
     }
 }
Example #6
0
        protected void Unnamed_Click(object sender, EventArgs e)
        {
            string   user          = Request.Form["UserName"];
            string   password      = Request.Form["Password"];
            BAL_User loginValidate = new BAL_User();

            Session["Role"] = ddl.SelectedValue;
            string role = ddl.SelectedValue;

            if (loginValidate.BALUserLoginValidate(user, password, role))
            {
                Session["UserName"] = user;
                Response.Redirect("~/" + role + "Home.aspx");
            }
            else
            {
                Session["Role"] = null;
                ClientScript.RegisterStartupScript(this.GetType(), "Popup", "successalert();", true);
            }
        }