public ActionResult Edit(InvoiceAdvance InvoiceAdvance) { InvoiceAdvance oInvoiceAdvance = new InvoiceAdvance(); oInvoiceAdvance.InvoiceID = System.Convert.ToInt32(InvoiceAdvance.InvoiceID); oInvoiceAdvance.AdvancePaymentID = System.Convert.ToInt32(InvoiceAdvance.AdvancePaymentID); oInvoiceAdvance = InvoiceAdvanceData.Select_Record(InvoiceAdvance); if (ModelState.IsValid) { bool bSucess = false; bSucess = InvoiceAdvanceData.Update(oInvoiceAdvance, InvoiceAdvance); if (bSucess == true) { return(RedirectToAction("Index")); } else { ModelState.AddModelError("", "Can Not Update"); } } // ComboBox ViewData["InvoiceID"] = new SelectList(InvoiceAdvance_InvoiceData.List(), "InvoiceID", "InvoiceID", InvoiceAdvance.InvoiceID); ViewData["AdvancePaymentID"] = new SelectList(InvoiceAdvance_AdvancePaymentData.List(), "AdvancePaymentID", "AdvancePaymentID", InvoiceAdvance.AdvancePaymentID); return(View(InvoiceAdvance)); }
// GET: /InvoiceAdvance/Edit/<id> public ActionResult Edit( Int32?InvoiceID , Int32?AdvancePaymentID ) { if ( InvoiceID == null || AdvancePaymentID == null ) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } InvoiceAdvance InvoiceAdvance = new InvoiceAdvance(); InvoiceAdvance.InvoiceID = System.Convert.ToInt32(InvoiceID); InvoiceAdvance.AdvancePaymentID = System.Convert.ToInt32(AdvancePaymentID); InvoiceAdvance = InvoiceAdvanceData.Select_Record(InvoiceAdvance); if (InvoiceAdvance == null) { return(HttpNotFound()); } // ComboBox ViewData["InvoiceID"] = new SelectList(InvoiceAdvance_InvoiceData.List(), "InvoiceID", "InvoiceID", InvoiceAdvance.InvoiceID); ViewData["AdvancePaymentID"] = new SelectList(InvoiceAdvance_AdvancePaymentData.List(), "AdvancePaymentID", "AdvancePaymentID", InvoiceAdvance.AdvancePaymentID); return(View(InvoiceAdvance)); }
// GET: /InvoiceAdvance/Create public ActionResult Create() { // ComboBox ViewData["InvoiceID"] = new SelectList(InvoiceAdvance_InvoiceData.List(), "InvoiceID", "InvoiceID"); ViewData["AdvancePaymentID"] = new SelectList(InvoiceAdvance_AdvancePaymentData.List(), "AdvancePaymentID", "AdvancePaymentID"); return(View()); }
public ActionResult Create([Bind(Include = "InvoiceID" + "," + "AdvancePaymentID" )] InvoiceAdvance InvoiceAdvance) { if (ModelState.IsValid) { bool bSucess = false; bSucess = InvoiceAdvanceData.Add(InvoiceAdvance); if (bSucess == true) { return(RedirectToAction("Index")); } else { ModelState.AddModelError("", "Can Not Insert"); } } // ComboBox ViewData["InvoiceID"] = new SelectList(InvoiceAdvance_InvoiceData.List(), "InvoiceID", "InvoiceID", InvoiceAdvance.InvoiceID); ViewData["AdvancePaymentID"] = new SelectList(InvoiceAdvance_AdvancePaymentData.List(), "AdvancePaymentID", "AdvancePaymentID", InvoiceAdvance.AdvancePaymentID); return(View(InvoiceAdvance)); }