Пример #1
0
        public ActionResult Delete(int?Id)
        {
            ReceiveOrderModel getById = Services.ReceiptOrderService.GetById(Id);

            // bool status = Services.ReceiptOrderService.Delete(Id);
            ViewBag.Status = getById.IsFinalize;
            return(View());
        }
Пример #2
0
        public ActionResult Edit(int Id)
        {
            ReceiveOrderModel RO = new ReceiveOrderModel();
            var ReceiptOrderById = Services.ReceiptOrderService.GetById(Id);

            RO.purchaseOrderItemList = Services.PurchaseOrderItemsService.GetItemsByPurchase(ReceiptOrderById.PurchaseOrderId ?? 0);
            RO.ReceiptNumber         = ReceiptOrderById.ReceiptNumber;
            RO.SupplierInvoice       = ReceiptOrderById.SupplierInvoice;
            RO.Id              = Id;
            RO.IsFinalize      = ReceiptOrderById.IsFinalize;
            RO.PurchaseOrderId = ReceiptOrderById.PurchaseOrderId;
            var receiptOrderItemList = Services.ReceiptOrderService.GetByReceiptOrderId(Id);

            RO.ReceiptOrderItems = ReceiptOrderById.ReceiptOrderItems;
            ViewBag.Count        = receiptOrderItemList.Count();
            return(View(RO));
        }
Пример #3
0
        public ActionResult Create(int id)
        {
            ReceiveOrderModel ROM = new ReceiveOrderModel();
            var list = Services.ReceiptOrderService.GetAllReceipt();

            ROM.ReceiptNumber       = Helper.CommonFunction.ReceiptNo(list);
            Session["ReceiveOrder"] = ROM.ReceiptNumber;
            ROM.PurchaseOrderId     = id;
            var receiptOrder = Services.ReceiptOrderService.ReceiptByPurchaseOrder(id);

            if (receiptOrder != null)
            {
                ROM.IsFinalize = receiptOrder.IsFinalize;
            }
            var create                = Services.ReceiptOrderService.Create(ROM);
            var ReceiptOrder          = Services.ReceiptOrderService.GetAllReceiptOrder(id);
            var purchaseOrderItemList = Services.PurchaseOrderItemsService.GetItemsByPurchase(id);

            ROM.purchaseOrderItemList = purchaseOrderItemList;
            ViewBag.ReceiptId         = ReceiptOrder.FirstOrDefault().Id;
            return(View(ROM));
        }
Пример #4
0
        public JsonResult Edit(int Id, ReceiveOrderModel model)
        {
            bool edit = Services.ReceiptOrderService.EditReceiptOrder(model);

            return(Json(edit, JsonRequestBehavior.AllowGet));
        }
Пример #5
0
        public JsonResult Create(int Id, ReceiveOrderModel model)
        {
            bool create = Services.ReceiptOrderService.AddReceiptOrder(model);

            return(Json(create, JsonRequestBehavior.AllowGet));
        }
Пример #6
0
 public bool Create(ReceiveOrderModel model)
 {
     return(ServerResponse.Invoke <bool>("/api/receiptOrder/create", JsonConvert.SerializeObject(model), "POST"));
 }
Пример #7
0
 public bool EditReceiptOrder(ReceiveOrderModel model)
 {
     return(ServerResponse.Invoke <bool>("/api/receiptOrder/EditReceiptOrder?Id=" + model.Id, JsonConvert.SerializeObject(model), "POST"));
 }