protected void btnUpdate_Click(object sender, EventArgs e) { string DCID = Helpers.Decode(Request.QueryString["id"]); c.ID = Convert.ToInt32(DCID); c.Account_No = txtAccountNumber.Text; c.Name = txtName.Text; c.Email = txtEmail.Text; c.updated_at = DateTime.Now; c.updated_by = "Debjit Roy"; c.updated_com_name = h.GetClientComputerName(); c.Status = drpStatus.SelectedValue.ToString(); bool updated = c.Update(); if (updated == true) { popup.Visible = true; message.InnerHtml = h.SuccessUpdated("Brand"); } else { popupDanger.Visible = false; errMessage.InnerHtml = h.ErrorUpdate("Brand", c.Error); } }
public ActionResult Edit(Brands brands) { if (ModelState.IsValid) { brands.Update(); return(RedirectToAction("Index")); } ViewBag.Error = string.Join("\n", ModelState.Values.SelectMany(x => x.Errors)); return(View(brands)); }