public async Task <ActionResult <Sewa> > Edit(string id, Sewa value) { // var product = new Product(value.Id); value.Id = ObjectId.Parse(id); _Sewa.Update(value, id); await _uow.Commit(); return(RedirectToAction("Index")); }
public async Task <ActionResult <Sewa> > Create(Sewa value) { //Sewa obj = new Sewa(value); _Sewa.Add(value); // it will be null //var testSewa = await _Sewa.GetById(value.); // If everything is ok then: await _uow.Commit(); // The product will be added only after commit // testProduct = await _productRepository.GetById(product.Id); return(RedirectToAction("Index")); }
//saving Sewa public string SaveSewa(Sewa k) { var message = ""; using (var context = new Entities2()) { var user = new Sewa() { Sewa1 = k.Sewa1 }; context.Sewas.Add(user); context.SaveChanges(); message = "save successfull"; } return(message); }
public ActionResult <Sewa> Create() { Sewa value = new Sewa(); return(View()); }
private void btnSewa_Click(object sender, EventArgs e) { Sewa rent = new Sewa(); OpenChildForm(rent, sender); }