public ActionResult UpdateProfile(Users_detail _details, HttpPostedFileBase image)
        {
            if (ModelState.IsValid)
            {
                if (image != null && image.ContentLength > 0)
                {
                    Random _rnd = new Random();

                    string _path =_rnd.Next(500, 100000)+ image.FileName  ;
                    var path = Path.Combine(Server.MapPath("~/UserData/"),
                                            System.IO.Path.GetFileName(_path));
                    image.SaveAs(path);
                    _details.image = "~/UserData/" + _path;

                }
                new Auth().UpdateProfile(_details);
                return RedirectToAction("Viewprofile", "Setting");
            }
            return View(_details);
        }
 public void UpdateProfile(Users_detail _userDetails)
 {
     string Uquery = _sb.AppendFormat("Update {0} set {0}.first_name='" + _userDetails.first_name + "' , {0}.last_name='" + _userDetails.last_name + "' , {0}.middle_name='" + _userDetails.middle_name + "' , {0}.other_detail='" + _userDetails.other_detail + "' , {0}.address='" + _userDetails.address + "' , {0}.phone='" + _userDetails.phone + "' , {0}.profession='" + _userDetails.profession + "', {0}.image='" + _userDetails.image + "' where {0}.user_id='" + _userDetails.user_id + "'", DBTables.ADMIN).ToString();
     _db.Execute(Uquery, new { _userDetails.user_id });
 }