public ActionResult Edit_Emp([Bind(Include = "id,name,address,phone,email")] Employee Emp)
 {
     if (ModelState.IsValid)
     {
         db.Entry(Emp).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Search_Emp"));
     }
     return(View(Emp));
 }
Exemplo n.º 2
0
        public async Task <IHttpActionResult> PutCompany(int id, Company company)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != company.Id)
            {
                return(BadRequest());
            }

            db.Entry(company).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CompanyExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
 public ActionResult Edit([Bind(Include = "Id,UserName,Address,Password")] User Euser)
 {
     if (ModelState.IsValid)
     {
         db.Entry(Euser).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(Euser));
 }
 public ActionResult Edit([Bind(Include = "id,name,email,phone,address")] Employee employee)
 {
     if (ModelState.IsValid)
     {
         db.Entry(employee).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(employee));
 }
Exemplo n.º 5
0
 public ActionResult Edit([Bind(Include = "Sponsor_id,Email,Name,Password")] Sponsor sponsor)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sponsor).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(sponsor));
 }
 public ActionResult Edit([Bind(Include = "Id,DictionaryName,SourceLanguage,Path")] Dictionaries dictionaries)
 {
     if (ModelState.IsValid)
     {
         db.Entry(dictionaries).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(dictionaries));
 }
Exemplo n.º 7
0
 public ActionResult Edit([Bind(Include = "column_0,Scientific_Name,Vernacular_name,Event_Date__parsed,Latitude,Longitude")] PestLocation pestLocation)
 {
     if (ModelState.IsValid)
     {
         db.Entry(pestLocation).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(pestLocation));
 }
        public ActionResult Edit([Bind(Include = "Name,Price,Description,Image ")] Meal meal, HttpPostedFileBase imgFile)
        {
            string path = "";

            if (imgFile.FileName.Length > 0)
            {
                path = "~/pics/" + Path.GetFileName(imgFile.FileName);
                imgFile.SaveAs(Server.MapPath(path));
            }
            meal.Image = path;

            //var before = db.Meals.AsNoTracking().Where(x => x.MealId == meal.MealId).ToList().FirstOrDefault();
            //meal.Name = before.Name;
            //meal.Price = before.Price;
            //meal.Description= before.Description;



            db.Entry(meal).State = EntityState.Modified;
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 9
0
 public ActionResult Arrangör(Arrangörer uppdaterad)
 {
     databas.Entry(uppdaterad).State = System.Data.Entity.EntityState.Modified;
     databas.SaveChanges();
     return(RedirectToAction("index"));
 }