Esempio n. 1
0
 public ActionResult Edit([Bind(Include = "EntityID,EntityShort,EntityLegalName,Corporation,Location,Country,Comment,UserID,DateModified,DateAdded")] EntityMaster entityMaster)
 {
     if (ModelState.IsValid)
     {
         db.Entry(entityMaster).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Corporation = new SelectList(db.CorporateMasters, "Corporate_ID", "CorporateShort", entityMaster.Corporation);
     ViewBag.Country     = new SelectList(db.CountryLists, "CountryID", "Country", entityMaster.Country);
     return(View(entityMaster));
 }
        public ActionResult Edit(ClientMasterEditModel viewModel)
        {
            if (ModelState.IsValid)
            {
                ClientMaster model = new ClientMaster();

                model.ClientID     = viewModel.ClientID;
                model.ClientName   = viewModel.ClientName;
                model.ClientDescr  = viewModel.ClientDescr;
                model.ClientStatus = viewModel.ClientStatus;
                model.UserMod      = User.Identity.GetAppUserId();
                model.DateModified = DateTime.Now;
                model.DateAdded    = viewModel.DateAdded;

                db.Entry(model).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            return(View(viewModel));
        }