public int capnhatDangkyhoadondientu(Dsdangkyhoadondientu entity) { var parameter = new SqlParameter[] { new SqlParameter("@id", entity.id), new SqlParameter("@chinhanh", entity.chinhanh ?? ""), new SqlParameter("@mausohd", entity.mausohd ?? ""), new SqlParameter("@kyhieuhd", entity.kyhieuhd ?? ""), new SqlParameter("@masothue", entity.masothue ?? ""), new SqlParameter("@sohoadon", entity.sohoadon.HasValue?entity.sohoadon.Value:0), new SqlParameter("@sohdtu", entity.sohdtu ?? ""), new SqlParameter("@sohdden", entity.sohdden ?? ""), new SqlParameter("@sudungtungay", entity.sudungtungay), new SqlParameter("@sudungdenngay", entity.sudungdenngay), new SqlParameter("@mainkey", entity.mainkey), new SqlParameter("@dienthoai", entity.dienthoai ?? ""), new SqlParameter("@diachi", entity.diachi ?? ""), new SqlParameter("@activation", entity.activation), new SqlParameter("@sitehddt", entity.sitehddt ?? ""), new SqlParameter("@usersite", entity.usersite ?? ""), new SqlParameter("@passsite", entity.passsite ?? "") }; return(_context.Database.ExecuteSqlCommand("spcapnhatDangkyhoadondientu @id, @chinhanh,@mausohd,@kyhieuhd,@masothue,@sohoadon,@sohdtu,@sohdden,@sudungtungay,@sudungdenngay,@mainkey,@dienthoai,@diachi,@activation,@sitehddt,@usersite,@passsite", parameter)); }
public IActionResult themDsDangkyhoadon() //(string chinhanh) { var d = new Dsdangkyhoadondientu(); d.sudungtungay = System.DateTime.Now; d.sudungdenngay = System.DateTime.Now; return(View(d)); }
public IActionResult themDsDangkyhoadon(Dsdangkyhoadondientu entity) { if (ModelState.IsValid) { entity.chinhanh = entity.chinhanh.ToUpper(); int n = _dsdangkyhdRepository.themDangkyhoadondientu(entity); if (n > 0) { SetAlert("Thêm đăng ký hoá đơn thành công", "success"); } else { SetAlert("Thêm đăng ký hoá đơn không thành công", "error"); } } return(View(entity)); }
public IActionResult capnhatDsDangkyhoadon(Dsdangkyhoadondientu entity) { if (ModelState.IsValid) { int n = _dsdangkyhdRepository.capnhatDangkyhoadondientu(entity); if (n > 0) { SetAlert("Cập nhật thông tin đăng ký hoá đơn thành công", "success"); } else { SetAlert("Cập nhật thông tin đăng ký hoá đơn không thành công", "error"); } //return Redirect(HttpContext.Session.GetString("urlEditHoadondt")); } return(View(entity)); }