コード例 #1
0
 public ActionResult EditUserDetails(tbl_UserDetailsss model, HttpPostedFileBase pic)
 {
     try
     {
         tbl_UserDetails abc = _user.Get(model.pkid);
         abc.FullName         = model.FullName;
         abc.ContactNumber    = model.ContactNumber;
         abc.AddressLine1     = model.AddressLine1;
         abc.RoleName         = model.RoleName;
         abc.EmailId          = model.EmailId;
         abc.LastModifiedDate = DateTime.Now;
         if (pic != null)
         {
             string path = System.Web.HttpContext.Current.Server.MapPath(model.ProdilePic);
             if (System.IO.File.Exists(path))
             {
                 System.IO.File.Delete(path);
             }
             WebFunction web = new WebFunction();
             model.ProdilePic = web.Storefile(pic, 4);
         }
         _user.Update(abc);
         return(RedirectToAction("Register", "Account"));
     }
     catch (Exception e)
     {
         Commonfunction.LogError(e, Server.MapPath("~/Log.txt"));
         ViewBag.Exception = e.Message;
         return(View());
     }
 }
コード例 #2
0
        public ActionResult EditUserDetails(int id)
        {
            var data = _user.Get(id);
            tbl_UserDetailsss abc = new tbl_UserDetailsss();

            abc.pkid             = data.pkid;
            abc.FullName         = data.FullName;
            abc.UserName         = data.UserName;
            abc.ContactNumber    = data.ContactNumber;
            abc.AddressLine1     = data.AddressLine1;
            abc.RoleName         = data.RoleName;
            abc.EmailId          = data.EmailId;
            abc.LastModifiedDate = DateTime.Now;
            return(View(abc));
        }
コード例 #3
0
        public ActionResult UserProfile()
        {
            string            Username = User.Identity.Name;
            var               data     = _user.GetAll().Where(x => x.UserName == Username).FirstOrDefault();
            tbl_UserDetailsss abc      = new tbl_UserDetailsss();

            abc.User_fkid      = data.User_fkid;
            abc.UserName       = data.UserName;
            abc.RoleName       = data.RoleName;
            abc.EmailId        = data.EmailId;
            abc.FullName       = data.FullName;
            abc.ContactNumber  = data.ContactNumber;
            abc.RegisteredDate = data.RegisteredDate;
            abc.AddressLine1   = data.AddressLine1;
            abc.AddressLine2   = data.AddressLine2;
            return(View(abc));
        }