Ejemplo n.º 1
0
        public ActionResult ManageUserAccount()
        {
            UserDetails       usd = (UserDetails)Session["UserData"];
            ManageUserDetails msd = new ManageUserDetails();

            if (usd.useremail != "")
            {
                msd.useremail = usd.useremail;
            }
            if (usd.Address1 != "")
            {
                msd.Address1 = usd.Address1;
            }
            if (usd.Address2 != "")
            {
                msd.Address2 = usd.Address2;
            }
            if (usd.City != "")
            {
                msd.City = usd.City;
            }
            if (usd.State != "")
            {
                msd.State = usd.State;
            }
            if (usd.pincode != "")
            {
                msd.Pincode = usd.pincode;
            }
            return(View("ManageAccount", msd));
        }
Ejemplo n.º 2
0
        public ActionResult ManageUserAccount(ManageUserDetails model)
        {
            UserDetails usd = (UserDetails)Session["UserData"];

            if (model.useremail != usd.useremail || model.Address1 != usd.Address1 || model.Address2 != usd.Address2 || model.City != usd.City || model.State != usd.State || model.Pincode != usd.pincode)
            {
                using (stuffWorks_BAL swBAL = new stuffWorks_BAL())
                {
                    Dictionary <string, string> userdict = new Dictionary <string, string>();
                    userdict.Add("userid", usd.userId.ToString());
                    userdict.Add("useremail", model.useremail);
                    userdict.Add("address1", model.Address1);
                    userdict.Add("address2", model.Address2);
                    userdict.Add("City", model.City);
                    userdict.Add("State", model.State);
                    userdict.Add("Pincode", model.Pincode.ToString());

                    swBAL.UpdateUserDetail(userdict);
                }
                Session["UserData"] = UserDetails.LoadUserData(model.useremail);
            }
            return(View("ManageAccount"));
        }