public PartialViewResult ViewDeliveryDetails(long deliveryId)
        {
            var deliveryDetails = _iDeliveryManager.GetDeliveredOrderDetailsByDeliveryId(deliveryId);
            var delivery        = _iDeliveryManager.GetOrderByDeliveryId(deliveryId);
            var client          = _iClientManager.GetById(delivery.ClientId);
            var model           = new ViewDeliveryModel
            {
                DeliveryDetailses = deliveryDetails.ToList(),
                Delivery          = delivery,
                Client            = client
            };

            return(PartialView("_ViewDeliveryOrderDetailsModalPartialPage", model));
        }
Пример #2
0
        public ActionResult Invoice(int deliveryId)
        {
            var delivery = _iDeliveryManager.GetOrderByDeliveryId(deliveryId);
            //var chalan = _iDeliveryManager.GetChalanByDeliveryId(deliveryId);
            var deliveryDetails = _iDeliveryManager.GetDeliveryDetailsInfoByDeliveryId(deliveryId);

            // var invocedOrder = _iInvoiceManager.GetInvoicedOrderByInvoiceId(deliveryId);
            var orderInfo = _iOrderManager.GetOrderInfoByTransactionRef(delivery.TransactionRef);
            //IEnumerable<InvoiceDetails> details = _iInvoiceManager.GetInvoicedOrderDetailsByInvoiceId(deliveryId);
            var client = _iClientManager.GetClientDeailsById(orderInfo.ClientId);

            ViewInvoiceModel model = new ViewInvoiceModel
            {
                Client          = client,
                Order           = orderInfo,
                Delivery        = delivery,
                DeliveryDetails = deliveryDetails
            };

            return(View(model));
        }
Пример #3
0
        public ActionResult Invoice(int deliveryId)
        {
            var delivery        = _iDeliveryManager.GetOrderByDeliveryId(deliveryId);
            var deliveryDetails = _iDeliveryManager.GetDeliveryDetailsInfoByDeliveryId(deliveryId);
            var orderInfo       = _iOrderManager.GetOrderInfoByTransactionRef(delivery.TransactionRef);
            var client          = _iClientManager.GetClientDeailsById(delivery.ClientId);

            var model = new ViewInvoiceModel
            {
                Client          = client,
                Order           = orderInfo,
                Delivery        = delivery,
                DeliveryDetails = deliveryDetails
            };

            return(View(model));
        }
        public JsonResult AddReturnProductToXmalFile(FormCollection collection)
        {
            SuccessErrorModel model = new SuccessErrorModel();

            try
            {
                int count          = 0;
                var collectionKeys = collection.AllKeys.ToList();
                foreach (string key in collectionKeys)
                {
                    if (collection[key] != "")
                    {
                        var first          = key.IndexOf("_", StringComparison.Ordinal) + 1;
                        var last           = key.LastIndexOf("_", StringComparison.Ordinal) + 1;
                        var quantity       = Convert.ToInt32(collection[key]);
                        var productId      = Convert.ToInt32(key.Substring(first, 3));
                        var product        = _iProductManager.GetProductByProductId(productId);
                        var deliveryRef    = key.Substring(0, first - 1);
                        var deliveryId     = key.Substring(last, key.Length - last);
                        var deliveredOrder = _iDeliveryManager.GetOrderByDeliveryId(Convert.ToInt32(deliveryId));
                        //var requisition = _iProductManager.GetRequsitions().ToList().Find(n => n.RequisitionId == requisitionId);
                        var filePath    = GetTempReturnProductsXmlFilePath();
                        var xmlDocument = XDocument.Load(filePath);
                        if (quantity > 0)
                        {
                            xmlDocument.Element("Products")?.Add(
                                new XElement("Product", new XAttribute("Id", Guid.NewGuid()),
                                             new XElement("DeliveryId", deliveryId),
                                             new XElement("DeliveryRef", deliveryRef),
                                             new XElement("ProuctId", productId),
                                             new XElement("Quantity", quantity),
                                             new XElement("ProductName", product.ProductName),
                                             new XElement("DeliveryDate", deliveredOrder.DeliveryDate)
                                             ));
                            xmlDocument.Save(filePath);
                            count++;
                        }
                    }
                }
                if (count > 0)
                {
                    model.Message = "<p style='color:green'>Added Successfully</p>";
                }

                return(Json(model, JsonRequestBehavior.AllowGet));
            }
            catch (Exception e)
            {
                Log.WriteErrorLog(e);
                model.Message = "<p style='color:red'> Failed to add" + e.Message + "</p>";
                return(Json(model, JsonRequestBehavior.AllowGet));
            }
        }
Пример #5
0
 public ActionResult DeliveryDetails(long id)
 {
     try
     {
         var deliveryDetails = _iDeliveryManager.GetDeliveredOrderDetailsByDeliveryId(id);
         var delivery        = _iDeliveryManager.GetOrderByDeliveryId(id);
         ICollection <ViewClientStockProduct> products = _iDeliveryManager.GetClientStockProductAgeByDeliveryId(id);
         ViewDeliveryModel model = new ViewDeliveryModel
         {
             DeliveryDetailses   = deliveryDetails.ToList(),
             Delivery            = delivery,
             Client              = _iClientManager.GetById(delivery.Client.ClientId),
             ClientStockProducts = products.ToList()
         };
         return(View(model));
     }
     catch (Exception exception)
     {
         Log.WriteErrorLog(exception);
         return(PartialView("_ErrorPartial", exception));
     }
 }