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)); }
public ActionResult DeleteConfirmed( Int32?InvoiceID , Int32?AdvancePaymentID ) { InvoiceAdvance InvoiceAdvance = new InvoiceAdvance(); InvoiceAdvance.InvoiceID = System.Convert.ToInt32(InvoiceID); InvoiceAdvance.AdvancePaymentID = System.Convert.ToInt32(AdvancePaymentID); InvoiceAdvance = InvoiceAdvanceData.Select_Record(InvoiceAdvance); bool bSucess = false; bSucess = InvoiceAdvanceData.Delete(InvoiceAdvance); if (bSucess == true) { return(RedirectToAction("Index")); } else { ModelState.AddModelError("", "Can Not Delete"); } return(null); }
// GET: /InvoiceAdvance/Delete/<id> public ActionResult Delete( Int32?InvoiceID , Int32?AdvancePaymentID ) { if ( InvoiceID == null || AdvancePaymentID == null ) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } dtInvoice = InvoiceAdvance_InvoiceData.SelectAll(); dtAdvancePayment = InvoiceAdvance_AdvancePaymentData.SelectAll(); InvoiceAdvance InvoiceAdvance = new InvoiceAdvance(); InvoiceAdvance.InvoiceID = System.Convert.ToInt32(InvoiceID); InvoiceAdvance.AdvancePaymentID = System.Convert.ToInt32(AdvancePaymentID); InvoiceAdvance = InvoiceAdvanceData.Select_Record(InvoiceAdvance); InvoiceAdvance.Invoice = new Invoice() { InvoiceID = (Int32)InvoiceAdvance.InvoiceID }; InvoiceAdvance.AdvancePayment = new AdvancePayment() { AdvancePaymentID = (Int32)InvoiceAdvance.AdvancePaymentID }; if (InvoiceAdvance == null) { return(HttpNotFound()); } return(View(InvoiceAdvance)); }