public ActionResult Edit_donhang(Donhang_Model model) { if (ModelState.IsValid) { var data = connect_entity.Donhangs.FirstOrDefault(x => x.IDhd.Equals(model.IDhd)); if (data != null) { data.IDhd = model.IDhd; data.Hoten = model.Hoten; data.SDT = model.SDT; data.Mail = model.Mail; data.Diachi = model.Diachi; data.Tinh = model.Tinh; data.Huyen = model.Huyen; data.Xungho = model.Xungho; data.Hinhthucgiaohang = model.Hinhthucgiaohang; // data.Tongtienhang = model.Tongtienhang; data.Duyet = model.Duyet; // data.ngaydathang = model.ngaydathang; data.GhiChuKhac = model.GhiChuKhac; data.Tiengiamgia = model.Tiengiamgia; connect_entity.SaveChanges(); ModelState.AddModelError("", "Bạn Cập nhật Thành Công, Bấm Back Danh Sách để quay trở về"); ViewBag.id = model.IDhd; string strURLOld = HttpContext.Request.UrlReferrer.ToString(); string strUrlHienTai = HttpContext.Request.Url.AbsoluteUri; return(Redirect(strURLOld)); } } return(View(model)); }
public void Deleteone(int Id) { var data = (from c in Connect_Enttity.information where c.Id == Id select c).FirstOrDefault(); if (data != null) { Connect_Enttity.information.Remove(data); Connect_Enttity.SaveChanges(); Dispose(); } }
public void Deleteone(int Id) { var data = (from c in Connect_Enttity.Bill_customers where c.billid == Id select c).FirstOrDefault(); if (data != null) { Connect_Enttity.Bill_customers.Remove(data); Connect_Enttity.SaveChanges(); Dispose(); } }
public void Deleteone(int Id) { var data = (from c in Connect_Enttity.DientuCapLoaithuoctinhs where c.Id == Id select c).FirstOrDefault(); if (data != null) { Connect_Enttity.DientuCapLoaithuoctinhs.Remove(data); Connect_Enttity.SaveChanges(); Dispose(); } }
public void Deleteone(int Id) { var data = (from c in Connect_Enttity.GroupMenuSanPhams where c.Id == Id select c).FirstOrDefault(); if (data != null) { Connect_Enttity.GroupMenuSanPhams.Remove(data); Connect_Enttity.SaveChanges(); Dispose(); } }
public void Deleteone(int Id) { var data = (from c in Connect_Enttity.service_charge where c.idservice == Id select c).FirstOrDefault(); if (data != null) { Connect_Enttity.service_charge.Remove(data); Connect_Enttity.SaveChanges(); Dispose(); } }
public void Deleteone(int Id) { var data = (from c in Connect_Enttity.Kichthuocs where c.ID == Id select c).FirstOrDefault(); if (data != null) { Connect_Enttity.Kichthuocs.Remove(data); Connect_Enttity.SaveChanges(); Dispose(); } }
public void Deleteone(int Id) { var data = (from c in Connect_Enttity.quantity_purchased where c.Id_quantity == Id select c).FirstOrDefault(); if (data != null) { Connect_Enttity.quantity_purchased.Remove(data); Connect_Enttity.SaveChanges(); Dispose(); } }
public void Deleteone(int Id) { string ID = Id.ToString(); var data = (from c in Connect_Enttity.Languages where c.Id == ID select c).FirstOrDefault(); if (data != null) { Connect_Enttity.Languages.Remove(data); Connect_Enttity.SaveChanges(); Dispose(); } }
// ChangeActive public int ChangeActive(int Id) { var data = connect_entity.DientuMenuSitemathangs.Find(Id); if (data.Active == false) { data.Active = true; } else if (data.Active == true) { data.Active = false; } connect_entity.SaveChanges(); return(Convert.ToInt32(data.Active)); }
// ChangeActive public int ChangeActive(int Id) { var data = connect_entity.GroupNews.Find(Id); if (data.Active == 0) { data.Active = 1; } else if (data.Active == 1) { data.Active = 0; } connect_entity.SaveChanges(); return(Convert.ToInt32(data.Active)); }
[Authorize(Roles = "Admin,Personnel")] //Personnel public JsonResult Deleteone(int Id) { string Idproduct = Id.ToString(); var DataDeltete = connect_entity.CommentProducs.Where(x => x.Level == Idproduct).ToList(); if (DataDeltete.Count > 0) { foreach (var item in DataDeltete) { connect_entity.CommentProducs.Remove(item); connect_entity.SaveChanges(); } } Connect.Deleteone(Id); Connect.Deleteone(Id); Resurt = 1; return(Json(Resurt, JsonRequestBehavior.AllowGet)); }
// ChangeActive public int ChangeActive(int Id) { var data = connect_entity.Thanhviens.Find(Id); if (data.Actice == false) { data.Actice = true; } else if (data.Actice == true) { data.Actice = false; } connect_entity.SaveChanges(); return(Convert.ToInt32(data.Actice)); }
// ChangeActive public int ChangeActive(int Id) { var data = connect_entity.quantity_purchased.Find(Id); if (data.Active == false) { data.Active = true; } else if (data.Active == true) { data.Active = false; } connect_entity.SaveChanges(); return(Convert.ToInt32(data.Active)); }
// ChangeActive public int ChangeActive(int Id) { var data = connect_entity.MacodeKhuyenMais.Find(Id); if (data.Active == false) { data.Active = true; } else if (data.Active == true) { data.Active = false; } connect_entity.SaveChanges(); return(Convert.ToInt32(data.Active)); }
// ChangeActive public int ChangeActive(string IdTag) { var data = connect_entity.DientuChitiethinhs.FirstOrDefault(x => x.IdTag == IdTag); if (data.Active == false) { data.Active = true; } else if (data.Active == true) { data.Active = false; } connect_entity.SaveChanges(); return(Convert.ToInt32(data.Active)); }
public void Deleteone(string IdTag) { var data = (from c in Connect_Enttity.DientuThuoctinhs where c.IdTag == IdTag select c).FirstOrDefault(); if (data != null) { Connect_Enttity.DientuThuoctinhs.Remove(data); Connect_Enttity.SaveChanges(); Dispose(); } }