Exemple #1
0
        public ActionResult ListUserProfile()
        {
            UserProfile      userProfile      = new UserProfile();
            UserProfileLayer userProfileLayer = new UserProfileLayer();
            SourceLayer      sourceLayer      = new SourceLayer();
            PositionLayer    positionLayer    = new PositionLayer();

            userProfile.listPosition = positionLayer.Selectalldata();
            userProfile.listSource   = sourceLayer.Selectalldata();
            userProfile.ListProfile  = userProfileLayer.Selectalldata();

            return(View(userProfile));
        }
Exemple #2
0
        public ActionResult UpdateUserProfile(string id)
        {
            UserProfileLayer userprofilelayer = new UserProfileLayer();
            PositionLayer    positionLayer    = new PositionLayer();
            SourceLayer      sourceLayer      = new SourceLayer();
            UserProfile      userprofile      = new UserProfile();

            userprofile = userprofilelayer.SelectDatabyID(id);
            userprofile.listPosition = positionLayer.Selectalldata();
            userprofile.listSource   = sourceLayer.Selectalldata();

            return(View(userprofile));
        }
Exemple #3
0
        public ActionResult UpdateUserProfile(UserProfile pro)
        {
            if (ModelState.IsValid)
            {
                UserProfileLayer upl    = new UserProfileLayer();
                string           result = upl.UpdateData(pro);
                TempData["UpdateResult"] = result;
                ModelState.Clear();

                return(RedirectToAction("ListUserProfile"));
            }
            else
            {
                ModelState.AddModelError("", "Error in updating data");
                return(RedirectToAction("UpdateUserProfile"));
            }
        }
Exemple #4
0
        public ActionResult InsertUserProfile(UserProfile pro, FormCollection form)
        {
            if (ModelState.IsValid)
            {
                UserProfileLayer upl    = new UserProfileLayer();
                string           result = upl.InsertData(pro);
                TempData["InsertResult"] = result;
                ModelState.Clear();

                return(RedirectToAction("ListUserProfile"));
            }
            else
            {
                ModelState.AddModelError("", "Error in saving data");
                return(RedirectToAction("InsertUserProfile"));
            }
        }