Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        // 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));
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        // 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));
        }