Ejemplo n.º 1
0
        public ActionResult Edit(InvoiceItem InvoiceItem)
        {
            InvoiceItem oInvoiceItem = new InvoiceItem();

            oInvoiceItem.InvoiceID     = System.Convert.ToInt32(InvoiceItem.InvoiceID);
            oInvoiceItem.InvoiceItemID = System.Convert.ToInt32(InvoiceItem.InvoiceItemID);
            oInvoiceItem = InvoiceItemData.Select_Record(InvoiceItem);

            if (ModelState.IsValid)
            {
                bool bSucess = false;
                bSucess = InvoiceItemData.Update(oInvoiceItem, InvoiceItem);
                if (bSucess == true)
                {
                    return(RedirectToAction("Index"));
                }
                else
                {
                    ModelState.AddModelError("", "Can Not Update");
                }
            }
            // ComboBox
            ViewData["InvoiceID"] = new SelectList(InvoiceItem_InvoiceData.List(), "InvoiceID", "InvoiceID", InvoiceItem.InvoiceID);

            return(View(InvoiceItem));
        }
Ejemplo n.º 2
0
        public ActionResult Create([Bind(Include =
                                             "InvoiceID"
                                             + "," + "InvoiceItemID"
                                             + "," + "Description"
                                             + "," + "Quantity"
                                             + "," + "Rate"
                                             + "," + "DiscountAmount"
                                             + "," + "CGSTRate"
                                             + "," + "SGSTRate"
                                             + "," + "IGSTRate"
                                         )] InvoiceItem InvoiceItem)
        {
            if (ModelState.IsValid)
            {
                bool bSucess = false;
                bSucess = InvoiceItemData.Add(InvoiceItem);
                if (bSucess == true)
                {
                    return(RedirectToAction("Index"));
                }
                else
                {
                    ModelState.AddModelError("", "Can Not Insert");
                }
            }
            // ComboBox
            ViewData["InvoiceID"] = new SelectList(InvoiceItem_InvoiceData.List(), "InvoiceID", "InvoiceID", InvoiceItem.InvoiceID);

            return(View(InvoiceItem));
        }
Ejemplo n.º 3
0
        // GET: /InvoiceItem/Edit/<id>
        public ActionResult Edit(
            Int32?InvoiceID
            , Int32?InvoiceItemID
            )
        {
            if (
                InvoiceID == null ||
                InvoiceItemID == null
                )
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            InvoiceItem InvoiceItem = new InvoiceItem();

            InvoiceItem.InvoiceID     = System.Convert.ToInt32(InvoiceID);
            InvoiceItem.InvoiceItemID = System.Convert.ToInt32(InvoiceItemID);
            InvoiceItem = InvoiceItemData.Select_Record(InvoiceItem);

            if (InvoiceItem == null)
            {
                return(HttpNotFound());
            }
            // ComboBox
            ViewData["InvoiceID"] = new SelectList(InvoiceItem_InvoiceData.List(), "InvoiceID", "InvoiceID", InvoiceItem.InvoiceID);

            return(View(InvoiceItem));
        }
Ejemplo n.º 4
0
        // GET: /InvoiceItem/Create
        public ActionResult Create()
        {
            // ComboBox
            ViewData["InvoiceID"] = new SelectList(InvoiceItem_InvoiceData.List(), "InvoiceID", "InvoiceID");

            return(View());
        }