Beispiel #1
0
        public bool EditProfile(Profilee obj)
        {
            var Process = string.Join(",", obj.Process);

            connection();
            SqlCommand com = new SqlCommand("UpdateProfile", con);

            com.CommandType = CommandType.StoredProcedure;

            var user = System.Web.HttpContext.Current.User.Identity.GetUserName();

            com.Parameters.AddWithValue("@User_name", user);
            com.Parameters.AddWithValue("@Dname", obj.Dname);
            com.Parameters.AddWithValue("@About", obj.About);
            com.Parameters.AddWithValue("@Process", Process);
            com.Parameters.AddWithValue("@Position", obj.Position);
            com.Parameters.AddWithValue("@Company", obj.Company);
            com.Parameters.AddWithValue("@Location", obj.Location);
            com.Parameters.AddWithValue("@Email", obj.Email);
            com.Parameters.AddWithValue("@Gender", obj.Gender);
            com.Parameters.AddWithValue("@ProfilePictureTheme", obj.ProfilePictureTheme);
            con.Open();
            int i = com.ExecuteNonQuery();

            con.Close();
            if (i >= 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public ActionResult EditProfile(string user, Profilee obj)

        {
            try
            {
                ProfileRepository PostRepo = new ProfileRepository();

                PostRepo.EditProfile(obj);
                return(RedirectToAction("MasterDetail"));
            }
            catch
            {
                return(View());
            }
        }