public PurchaseDeliveryDetail(int deliveryId, PageMode pm) : base(pm)
 {
     InitializeComponent();
     ModuleName = "PurchaseDelivery";
     VM = new DeliveryVM(deliveryId);
     BindData();
 }
 public PurchaseDeliveryDetail(PageMode pm) : base(pm)
 {
     InitializeComponent();
     ModuleName = "PurchaseDelivery";
     VM = new DeliveryVM(DeliveryType.InternalTDBOL);
     BindData();
 }
 public ActionResult Delivery(DeliveryVM model)
 {
     if (ModelState.IsValid)
     {
         DeliveryDTO delivery = new DeliveryDTO();
         delivery.PayType      = model.PayType;
         delivery.DeliveryType = model.DeliveryType;
         delivery.Wishes       = model.Wishes;
         if (model.Post != null && model.PostDepartment != null)
         {
             delivery.DeliveryAddress = model.Post + " | " + model.PostDepartment + " | " + model.DeliveryAddress;
         }
         else
         {
             delivery.DeliveryAddress = model.DeliveryAddress;
         }
         _clientService.MakeDelivery(model.OrderId, delivery);
         if (model.PayType == "Карта")
         {
             return(RedirectToAction("Pay", "Client", new { orderId = model.OrderId }));
         }
         else
         {
             return(RedirectToAction("Orders", "Client"));
         }
     }
     return(View());
 }
 public NewImportDeliveryDetail(int deliveryId, PageMode pageMode)
 {
     InitializeComponent();
     ModuleName = "PurchaseDelivery";
     DVM = new DeliveryVM(deliveryId);
     BindData();
 }
Example #5
0
 public Delivery(CartVM kart)
 {
     InitializeComponent();
     cart        = kart;
     del         = new DeliveryVM(cart);
     DataContext = new DeliveryVM(cart);
 }
 public ExportWRDetail()
 {
     InitializeComponent();
     ModuleName = "SalesDelivery";
     VM = new DeliveryVM(DeliveryType.ExternalMDWW);
     BindData();
 }
        public IActionResult Index()
        {
            if (HttpContext.Session.GetString("UserRoleId") == "2")
            {
                var totalOrders            = orderService.CountOrders().GroupBy(q => q.HiddenPKId);
                var successfulDeliveries   = deliveryService.CountDeliveries().GroupBy(q => q.Order.HiddenPKId);
                var cancelledOrders        = orderService.CancelledOrdersforChart().GroupBy(q => q.HiddenPKId);
                var returnedRefundedOrders = deliveryService.ReturnedRefundedListforChart().GroupBy(q => q.Order.HiddenPKId);
                var products = productInventoryService.ProductList().Sum(q => q.AvailableQuantity);
                var profit   = deliveryService.DeliveredOrderforProfit().Sum(q =>
                                                                             (q.Order.ProductInventory.SellPrice - q.Order.ProductInventory.PurchasePrice) * q.Order.Quantity);

                DeliveryVM deliveryVM = new DeliveryVM()
                {
                    TotalOrderVMCount                 = totalOrders.Count(),
                    TotalDeliveryVMCount              = successfulDeliveries.Count(),
                    TotalAvaiableProductVMCount       = products,
                    TotalCancelledOrderVMCount        = cancelledOrders.Count(),
                    TotalReturnedRefundedOrderVMCount = returnedRefundedOrders.Count(),
                    ProfitVM = profit / 100
                };
                return(View(deliveryVM));
            }
            return(RedirectToAction("Index", "Home"));
        }
Example #8
0
        public IActionResult Index()
        {
            if (HttpContext.Session.GetString("UserRoleId") == "3")
            {
                var totalOrders            = orderService.CountOrders().GroupBy(q => q.HiddenPKId);
                var pendingOrders          = orderService.PendingOrderList().GroupBy(q => q.HiddenPKId);
                var pendingDeliveries      = deliveryService.PendingDeliveryList().GroupBy(q => q.Order.HiddenPKId);
                var successfulDeliveries   = deliveryService.CountDeliveries().GroupBy(q => q.Order.HiddenPKId);
                var cancelledOrders        = orderService.CancelledOrdersforChart().GroupBy(q => q.HiddenPKId);
                var returnedRefundedOrders = deliveryService.ReturnedRefundedListforChart().GroupBy(q => q.Order.HiddenPKId);
                var pendingReturnRefunds   = orderService.PendingReturnRefundList().GroupBy(q => q.Order.HiddenPKId);
                var products = productInventoryService.ProductList().Sum(q => q.AvailableQuantity);

                DeliveryVM deliveryVM = new DeliveryVM()
                {
                    TotalOrderVMCount                 = totalOrders.Count(),
                    TotalPendingOrdersVMCount         = pendingOrders.Count(),
                    TotalPendingDeliveryVMCount       = pendingDeliveries.Count(),
                    TotalDeliveryVMCount              = successfulDeliveries.Count(),
                    TotalCancelledOrderVMCount        = cancelledOrders.Count(),
                    TotalPendingReturnRefundVMCount   = pendingReturnRefunds.Count(),
                    TotalReturnedRefundedOrderVMCount = returnedRefundedOrders.Count(),
                    TotalAvaiableProductVMCount       = products
                };
                return(View(deliveryVM));
            }
            return(RedirectToAction("Index", "Home"));
        }
 public ExportWRDetail(int deliveryId)
 {
     InitializeComponent();
     ModuleName = "SalesDelivery";
     VM = new DeliveryVM(deliveryId);
     BindData();
 }
 public ActionResult DeliverySnimi(DeliveryVM vm)
 {
     if (vm.selektovani == 0 || vm.selektovani == null)
     {
         return(RedirectToAction("CheckoutDelivery"));
     }
     GlobalHelp.aktivnaNarudzba.NacinDostaveID = vm.selektovani;
     return(RedirectToAction("CheckoutPayment"));
 }
        //private Delivery deliveryToEdit;

        public EditDelivery(DeliveryVM dvm)
        {
            //this.deliveryToEdit = deliveryToEdit;
            NavigationPage.SetHasNavigationBar(this, false);
            BindingContext = dvm;
            dvm.UpdateCommandCompleteResponse = ShowAlert;
            dvm.ChangeDelivery.Status = DeliveryVM.GetStatusIndex(dvm.ChangeDelivery.Status);
            Status = DeliveryVM.DeliveryStatus;
            DrawLayout();
        }
        public ActionResult Delivery(int orderId)
        {
            if (orderId == 0)
            {
                return(RedirectToAction("PageNotFound", "Client"));
            }
            DeliveryVM result = new DeliveryVM();

            result.OrderId = orderId;
            return(View(result));
        }
Example #13
0
        public IActionResult Index()
        {
            var        pendingDeliveries    = deliveryService.PendingDeliveryList().GroupBy(q => q.Order.HiddenPKId);
            var        successfulDeliveries = deliveryService.CountDeliveries().GroupBy(q => q.Order.HiddenPKId);
            var        pendingReturnRefunds = orderService.PendingReturnRefundList().GroupBy(q => q.Order.HiddenPKId);
            var        cancelledOrders      = deliveryService.CountCancelledfromDeliverables().GroupBy(q => q.Order.HiddenPKId);
            DeliveryVM deliveryVM           = new DeliveryVM()
            {
                TotalPendingDeliveryVMCount     = pendingDeliveries.Count(),
                TotalDeliveryVMCount            = successfulDeliveries.Count(),
                TotalPendingReturnRefundVMCount = pendingReturnRefunds.Count(),
                TotalCancelledOrderVMCount      = cancelledOrders.Count()
            };

            return(View(deliveryVM));
        }
        public List <DeliveryVM> GetOrderedProductbyHiddenPKIdtoReturn(int id)
        {
            var productsfromOrder         = orderService.GetListofProductfromDeliverytoReturn(id);
            List <DeliveryVM> deliveryVMs = new List <DeliveryVM>();

            if (productsfromOrder.Count != 0)
            {
                for (int i = 0; i < productsfromOrder.Count; i++)
                {
                    DeliveryVM deliveryVM = new DeliveryVM();
                    deliveryVM.HiddenPKVMId   = id;
                    deliveryVM.CustomerVMName = productsfromOrder[i].Order.Customer.CustomerName;
                    deliveryVM.ProductVMName  = productsfromOrder[i].Order.ProductInventory.Name;
                    deliveryVM.ProductVMId    = productsfromOrder[i].Order.ProductInventoryId;
                    deliveryVM.QuantityVM     = productsfromOrder[i].Order.Quantity;
                    deliveryVM.DeliveryVMId   = productsfromOrder[i].DeliveryId;
                    deliveryVMs.Add(deliveryVM);
                }
            }
            return(deliveryVMs);
        }
        public ActionResult CheckoutDelivery()
        {
            if (GlobalHelp.aktivnaNarudzba.NacinDostaveID == null)
            {
                var model = new DeliveryVM
                {
                    dostave = ctx.NacinDostave.ToList(),

                    selektovani = 0
                };
                return(View("CheckoutDelivery", model));
            }
            else
            {
                var model = new DeliveryVM
                {
                    dostave = ctx.NacinDostave.ToList(),

                    selektovani = GlobalHelp.aktivnaNarudzba.NacinDostaveID
                };
                return(View("CheckoutDelivery", model));
            }
        }
        public MainPage()
        {
            try
            {
                InitializeComponent();
                NavigationPage.SetHasNavigationBar(this, false);

                if (BindingContext == null)
                {
                    BindingContext = DeliveryVM.GetInstance();
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
                Debug.WriteLine(ex.StackTrace);
                if (ex.InnerException != null)
                {
                    var inEx = ex.InnerException;
                    Debug.WriteLine(inEx.Message);
                    Debug.WriteLine(inEx.StackTrace);
                }
            }
        }
        public IActionResult ComplaintIndividualInfo(int id)
        {
            List <DeliveryVM> deliveryVMs = new List <DeliveryVM>();
            var details = deliveryService.GetInfobyHiddenIdforReturnRefundIndividualInfo(id);

            if (details.Count != 0)
            {
                var pass = from a in details
                           group a by a.Order.CustomerId into b
                           let c = (from d in b
                                    select new
                {
                    orderId = d.OrderId,
                    deliveryId = d.DeliveryId,
                    hiddenPkId = d.Order.HiddenPKId,
                    customerId = b.Key,
                    customerName = d.Order.Customer.CustomerName,
                    district = d.Order.Customer.District,
                    subdistrict = d.Order.Customer.SubDistrict,
                    area = d.Order.Customer.Area,
                    roadNo = d.Order.Customer.RoadNo,
                    houseNo = d.Order.Customer.HouseNo,
                    contact = d.Order.Customer.ContactNo,
                    shippingId = d.Order.ShippingId,
                    shipping = d.Order.Shipping.ShippingMethod,
                    payementId = d.Order.PaymentId,
                    payement = d.Order.Payment.PaymentMethod,
                    productId = d.Order.ProductInventoryId,
                    product = d.Order.ProductInventory.Name,
                    quantity = d.Order.Quantity,
                    totalPrice = d.Order.ProductInventory.SellPrice,
                    status = d.Status,
                    orderPlacedDate = d.Order.OrderDate,
                    orderDeliveredDate = d.DeliveredDate,
                    complaintDescription = d.ComplaintDescription
                })
                                   select c;
                ProductInventory_VM       productInventory_VM = new ProductInventory_VM();
                List <ProductInventoryVM> productInventoryVMs = new List <ProductInventoryVM>();
                foreach (var item in pass)
                {
                    var deliveryVM = new DeliveryVM();
                    foreach (var i in item)
                    {
                        ProductInventoryVM productInventoryVM = new ProductInventoryVM();
                        productInventoryVM.NameVM        = i.product;
                        productInventoryVM.QuantityVM    = i.quantity;
                        productInventoryVM.EachPriceVM   = i.totalPrice * i.quantity;
                        deliveryVM.TotalPriceVM         += productInventoryVM.EachPriceVM;
                        productInventoryVM.StatusVM      = i.status;
                        deliveryVM.OrderVMId             = i.orderId;
                        deliveryVM.HiddenPKVMId          = i.hiddenPkId;
                        deliveryVM.CustomerVMId          = i.customerId;
                        deliveryVM.CustomerVMName        = i.customerName;
                        deliveryVM.CustomerVMArea        = i.area;
                        deliveryVM.CustomerVMDistrict    = i.district;
                        deliveryVM.CustomerVMSubDistrict = i.subdistrict;
                        deliveryVM.CustomerVMHouseNo     = i.houseNo;
                        deliveryVM.CustomerVMRoadNo      = i.roadNo;
                        deliveryVM.CustomerVMContactNo   = i.contact;
                        deliveryVM.ShippingVMId          = i.shippingId;
                        deliveryVM.ShippingVMMethod      = i.shipping;
                        deliveryVM.PaymentVMId           = i.payementId;
                        deliveryVM.PaymentVMMethod       = i.payement;
                        deliveryVM.ProductVMId           = i.productId;
                        if (deliveryService.GetReturnRefundListbyHiddenId(i.hiddenPkId).Count != 0)
                        {
                            if (deliveryService.TobeReturned(i.orderId) != null || deliveryService.Returned(i.orderId) != null)
                            {
                                productInventoryVM.StringStatusVM = "Return";
                            }
                            else if (deliveryService.TobeRefunded(i.orderId) != null || deliveryService.Refunded(i.orderId) != null)
                            {
                                productInventoryVM.StringStatusVM = "Refund";
                            }
                            else if (deliveryService.TobeReturnedandRefunded(i.orderId) != null || deliveryService.ReturnedandRefunded(i.orderId) != null)
                            {
                                productInventoryVM.StringStatusVM = "Return & Refund";
                            }
                        }
                        deliveryVM.OrderPlacedVMDate = i.orderPlacedDate;
                        deliveryVM.DeliveredVMDate   = i.orderDeliveredDate;
                        if (deliveryService.GetReturnRefundListbyHiddenId(i.hiddenPkId).Count != 0)
                        {
                            if (deliveryService.ReturnRefundwithComplaintDescription(i.orderId) != null)
                            {
                                productInventoryVM.ComplaintDescriptionVM = i.complaintDescription;
                            }
                        }
                        deliveryVM.productInventory_VM.productInventoryVMs.Add(productInventoryVM);
                    }
                    deliveryVMs.Add(deliveryVM);
                }
            }
            return(View(deliveryVMs));
        }
Example #18
0
        //public IActionResult DeliverableOrderList(int? Page)
        //{
        //    var pageNumber = Page ?? 1;
        //    int pageSize = 5;
        //    int sl = 1;
        //    List<DeliveryVM> deliverieVMs = new List<DeliveryVM>();
        //    var deliverableOrders = deliveryService.DeliveryList();
        //    if (deliverableOrders!=null)
        //    {
        //        var pass = from a in deliverableOrders
        //                   group a by a.Order.CustomerId into b
        //                   let c = (from d in b
        //                            select new
        //                            {
        //                                orderId=d.OrderId,
        //                                deliveryId=d.DeliveryId,
        //                                customerId=b.Key,
        //                                customerName=d.Order.Customer.CustomerName,
        //                                area = d.Order.Customer.Area,
        //                                contact = d.Order.Customer.ContactNo,
        //                                shippingId = d.Order.ShippingId,
        //                                shipping = d.Order.Shipping.ShippingMethod,
        //                                payementId = d.Order.PaymentId,
        //                                payement = d.Order.Payment.PaymentMethod,
        //                                productId = d.Order.ProductInventoryId,
        //                                product = d.Order.ProductInventory.Name,
        //                                quantity = d.Order.Quantity,
        //                                totalPrice = d.Order.ProductInventory.SellPrice,
        //                                status = d.Status,
        //                                orderPlacedDate = d.Order.OrderDate,
        //                                deliveredDate=d.DeliveredDate
        //                            })
        //                   select c;
        //        ProductInventory_VM productInventory_VM = new ProductInventory_VM();
        //        List<ProductInventoryVM> productInventoryVMs = new List<ProductInventoryVM>();
        //        foreach (var item in pass)
        //        {
        //            var deliveryVM = new DeliveryVM();

        //            foreach (var i in item)
        //            {
        //                ProductInventoryVM productInventoryVM = new ProductInventoryVM();
        //                productInventoryVM.NameVM = i.product;
        //                productInventoryVM.QuantityVM = i.quantity;
        //                productInventoryVM.EachPriceVM = i.totalPrice * i.quantity;
        //                deliveryVM.TotalPriceVM += productInventoryVM.EachPriceVM;
        //                productInventoryVM.StatusVM = i.status;
        //                deliveryVM.SerialNo = sl;
        //                deliveryVM.OrderVMId = i.orderId;
        //                deliveryVM.CustomerVMId = i.customerId;
        //                deliveryVM.CustomerVMName = i.customerName;
        //                deliveryVM.CustomerVMArea = i.area;
        //                deliveryVM.CustomerVMContactNo = i.contact;
        //                deliveryVM.ShippingVMId = i.shippingId;
        //                deliveryVM.ShippingVMMethod = i.shipping;
        //                deliveryVM.PaymentVMId = i.payementId;
        //                deliveryVM.PaymentVMMethod = i.payement;
        //                deliveryVM.ProductVMId = i.productId;
        //                if (deliveryService.GetDeliveryInfobyOrderId(i.orderId) != null)
        //                {
        //                    if (deliveryService.GetTrueStatusDeliveryInfobyOrderId(i.orderId) != null)
        //                    {
        //                        deliveryVM.StatusVM = true;
        //                        deliveryVM.StringStatusVM = "Delivered";
        //                    }
        //                    else
        //                    {
        //                        deliveryVM.StatusVM = false;
        //                        deliveryVM.StringStatusVM = "Pending";
        //                    }
        //                }
        //                else
        //                {
        //                    deliveryVM.StatusVM = false;
        //                    deliveryVM.StringStatusVM = "Pending";
        //                }
        //                deliveryVM.DeliveredVMDate = i.deliveredDate;
        //                deliveryVM.OrderPlacedVMDate = i.orderPlacedDate;
        //                deliveryVM.productInventory_VM.productInventoryVMs.Add(productInventoryVM);
        //            }
        //            deliverieVMs.Add(deliveryVM);
        //            sl++;
        //        }
        //    }
        //    return View(deliverieVMs.ToPagedList(pageNumber, pageSize));
        //}
        public IActionResult PendingDeliveryList(int?Page)
        {
            var pageNumber = Page ?? 1;
            int pageSize   = 5;
            int sl         = 1;
            List <DeliveryVM> deliveryVMs = new List <DeliveryVM>();
            var deliverableOrders         = deliveryService.PendingDeliveryList();

            if (deliverableOrders != null)
            {
                var pass = from a in deliverableOrders
                           //group a by new { a.Order.CustomerId, a.Status, a.Order.OrderDate } into b
                           group a by new { a.Order.CustomerId, a.Status, a.Order.HiddenPKId } into b
                orderby b.Key.CustomerId
                let c = (from d in b
                         select new
                {
                    orderId = d.OrderId,
                    deliveryId = d.DeliveryId,
                    customerId = b.Key.CustomerId,
                    //edited newly
                    hiddenPkId = b.Key.HiddenPKId,
                    customerName = d.Order.Customer.CustomerName,
                    area = d.Order.Customer.Area,
                    district = d.Order.Customer.District,
                    subDistrict = d.Order.Customer.SubDistrict,
                    houseNo = d.Order.Customer.HouseNo,
                    roadNo = d.Order.Customer.RoadNo,
                    contact = d.Order.Customer.ContactNo,
                    shippingId = d.Order.ShippingId,
                    shipping = d.Order.Shipping.ShippingMethod,
                    payementId = d.Order.PaymentId,
                    payement = d.Order.Payment.PaymentMethod,
                    productId = d.Order.ProductInventoryId,
                    product = d.Order.ProductInventory.Name,
                    quantity = d.Order.Quantity,
                    totalPrice = d.Order.ProductInventory.SellPrice,
                    status = b.Key.Status,
                    //orderPlacedDate = b.Key.OrderDate,
                    orderPlacedDate = d.Order.OrderDate,
                    deliveredDate = d.DeliveredDate
                })
                        select c;
                ProductInventory_VM       productInventory_VM = new ProductInventory_VM();
                List <ProductInventoryVM> productInventoryVMs = new List <ProductInventoryVM>();
                foreach (var item in pass)
                {
                    var deliveryVM = new DeliveryVM();

                    foreach (var i in item)
                    {
                        ProductInventoryVM productInventoryVM = new ProductInventoryVM();
                        productInventoryVM.NameVM      = i.product;
                        productInventoryVM.QuantityVM  = i.quantity;
                        productInventoryVM.EachPriceVM = i.totalPrice * i.quantity;
                        deliveryVM.TotalPriceVM       += productInventoryVM.EachPriceVM;
                        productInventoryVM.StatusVM    = i.status;
                        deliveryVM.SerialNo            = sl;
                        deliveryVM.OrderVMId           = i.orderId;
                        deliveryVM.CustomerVMId        = i.customerId;
                        //edited newly
                        deliveryVM.HiddenPKVMId          = i.hiddenPkId;
                        deliveryVM.CustomerVMName        = i.customerName;
                        deliveryVM.CustomerVMArea        = i.area;
                        deliveryVM.CustomerVMDistrict    = i.district;
                        deliveryVM.CustomerVMSubDistrict = i.subDistrict;
                        deliveryVM.CustomerVMHouseNo     = i.houseNo;
                        deliveryVM.CustomerVMRoadNo      = i.roadNo;
                        deliveryVM.CustomerVMContactNo   = i.contact;
                        deliveryVM.ShippingVMId          = i.shippingId;
                        deliveryVM.ShippingVMMethod      = i.shipping;
                        deliveryVM.PaymentVMId           = i.payementId;
                        deliveryVM.PaymentVMMethod       = i.payement;
                        deliveryVM.ProductVMId           = i.productId;
                        if (deliveryService.GetDeliveryInfobyOrderId(i.orderId) != null)
                        {
                            if (deliveryService.GetTrueStatusDeliveryInfobyOrderId(i.orderId) != null)
                            {
                                deliveryVM.StatusVM       = true;
                                deliveryVM.StringStatusVM = "Delivered";
                            }
                            else
                            {
                                deliveryVM.StatusVM       = false;
                                deliveryVM.StringStatusVM = "Pending";
                            }
                        }
                        else
                        {
                            deliveryVM.StatusVM       = false;
                            deliveryVM.StringStatusVM = "Pending";
                        }
                        deliveryVM.DeliveredVMDate   = i.deliveredDate;
                        deliveryVM.OrderPlacedVMDate = i.orderPlacedDate;
                        deliveryVM.productInventory_VM.productInventoryVMs.Add(productInventoryVM);
                    }
                    deliveryVMs.Add(deliveryVM);
                    sl++;
                }
            }
            return(View(deliveryVMs.ToPagedList(pageNumber, pageSize)));
        }
        public IActionResult ComplaintList(int?Page)
        {
            if (HttpContext.Session.GetString("UserRoleId") == "2")
            {
                var pageNumber = Page ?? 1;
                int pageSize   = 10;
                int sl         = 1;
                List <DeliveryVM> deliveryVMs = new List <DeliveryVM>();
                var orders = orderService.ComplaintListofTobeReturnedRefunded();
                if (orders != null)
                {
                    var pass = from a in orders
                               group a by new { a.Order.HiddenPKId } into b
                    orderby b.Key.HiddenPKId
                    let c = (from d in b
                             select new
                    {
                        orderId = d.OrderId,
                        hiddenPKId = b.Key.HiddenPKId,
                        customerId = d.Order.CustomerId,
                        customerName = d.Order.Customer.CustomerName,
                        area = d.Order.Customer.Area,
                        contact = d.Order.Customer.ContactNo,
                        shippingId = d.Order.ShippingId,
                        shipping = d.Order.Shipping.ShippingMethod,
                        payementId = d.Order.PaymentId,
                        payement = d.Order.Payment.PaymentMethod,
                        productId = d.Order.ProductInventoryId,
                        product = d.Order.ProductInventory.Name,
                        quantity = d.Order.Quantity,
                        totalPrice = d.Order.ProductInventory.SellPrice,
                        status = d.Status,
                        orderPlacedDate = d.Order.OrderDate,
                        orderDeliveredDate = d.DeliveredDate,
                    })
                            select c;
                    ProductInventory_VM       productInventory_VM = new ProductInventory_VM();
                    List <ProductInventoryVM> productInventoryVMs = new List <ProductInventoryVM>();
                    foreach (var item in pass)
                    {
                        var deliveryVM = new DeliveryVM();

                        foreach (var i in item)
                        {
                            ProductInventoryVM productInventoryVM = new ProductInventoryVM();
                            productInventoryVM.NameVM      = i.product;
                            productInventoryVM.QuantityVM  = i.quantity;
                            productInventoryVM.EachPriceVM = i.totalPrice * i.quantity;
                            deliveryVM.TotalPriceVM       += productInventoryVM.EachPriceVM;
                            productInventoryVM.StatusVM    = i.status;
                            deliveryVM.SerialNo            = sl;
                            deliveryVM.OrderVMId           = i.orderId;
                            deliveryVM.HiddenPKVMId        = i.hiddenPKId;
                            deliveryVM.CustomerVMId        = i.customerId;
                            deliveryVM.CustomerVMName      = i.customerName;
                            deliveryVM.CustomerVMArea      = i.area;
                            deliveryVM.CustomerVMContactNo = i.contact;
                            deliveryVM.ShippingVMId        = i.shippingId;
                            deliveryVM.ShippingVMMethod    = i.shipping;
                            deliveryVM.PaymentVMId         = i.payementId;
                            deliveryVM.PaymentVMMethod     = i.payement;
                            deliveryVM.ProductVMId         = i.productId;
                            if (deliveryService.DoneReturnedandRefunded(i.hiddenPKId) != null)
                            {
                                deliveryVM.StringReturnedRefundedVMStatus = "Done";
                            }
                            else if (deliveryService.PendingReturnedandRefunded(i.hiddenPKId) != null)
                            {
                                deliveryVM.StringReturnedRefundedVMStatus = "Pending";
                            }
                            deliveryVM.OrderPlacedVMDate = i.orderPlacedDate;
                            deliveryVM.DeliveredVMDate   = i.orderDeliveredDate;
                            if (deliveryService.GetReturnRefundListbyHiddenId(i.hiddenPKId).Count != 0)
                            {
                                if (deliveryService.TobeReturned(i.orderId) != null || deliveryService.Returned(i.orderId) != null)
                                {
                                    productInventoryVM.StringStatusVM = "Return";
                                }
                                else if (deliveryService.TobeRefunded(i.orderId) != null || deliveryService.Refunded(i.orderId) != null)
                                {
                                    productInventoryVM.StringStatusVM = "Refund";
                                }
                                else if (deliveryService.TobeReturnedandRefunded(i.orderId) != null || deliveryService.ReturnedandRefunded(i.orderId) != null)
                                {
                                    productInventoryVM.StringStatusVM = "Return & Refund";
                                }
                                //else
                                //{
                                //    productInventoryVM.StringStatusVM = "Delivered";
                                //}
                            }
                            deliveryVM.productInventory_VM.productInventoryVMs.Add(productInventoryVM);
                        }
                        deliveryVMs.Add(deliveryVM);
                        sl++;
                    }
                }
                return(View(deliveryVMs.ToPagedList(pageNumber, pageSize)));
            }
            return(RedirectToAction("Index", "Home"));
        }
Example #20
0
        public IActionResult OrderIndividualInfo(int id)
        {
            List <DeliveryVM> deliveryVMs = new List <DeliveryVM>();
            var deliveries = deliveryService.GetListofCustomerbyIdIndividual(id);

            if (deliveries.Count != 0)
            {
                var pass = from a in deliveries
                           group a by a.Order.CustomerId into b
                           let c = (from d in b
                                    select new
                {
                    orderId = d.OrderId,
                    deliveryId = d.DeliveryId,
                    customerId = b.Key,
                    customerName = d.Order.Customer.CustomerName,
                    district = d.Order.Customer.District,
                    subdistrict = d.Order.Customer.SubDistrict,
                    area = d.Order.Customer.Area,
                    roadNo = d.Order.Customer.RoadNo,
                    houseNo = d.Order.Customer.HouseNo,
                    contact = d.Order.Customer.ContactNo,
                    shippingId = d.Order.ShippingId,
                    shipping = d.Order.Shipping.ShippingMethod,
                    payementId = d.Order.PaymentId,
                    payement = d.Order.Payment.PaymentMethod,
                    productId = d.Order.ProductInventoryId,
                    product = d.Order.ProductInventory.Name,
                    quantity = d.Order.Quantity,
                    totalPrice = d.Order.ProductInventory.SellPrice,
                    status = d.Status,
                    orderPlacedDate = d.Order.OrderDate
                })
                                   select c;
                ProductInventory_VM       productInventory_VM = new ProductInventory_VM();
                List <ProductInventoryVM> productInventoryVMs = new List <ProductInventoryVM>();
                foreach (var item in pass)
                {
                    var deliveryVM = new DeliveryVM();
                    foreach (var i in item)
                    {
                        ProductInventoryVM productInventoryVM = new ProductInventoryVM();
                        productInventoryVM.NameVM        = i.product;
                        productInventoryVM.QuantityVM    = i.quantity;
                        productInventoryVM.EachPriceVM   = i.totalPrice * i.quantity;
                        deliveryVM.TotalPriceVM         += productInventoryVM.EachPriceVM;
                        productInventoryVM.StatusVM      = i.status;
                        deliveryVM.OrderVMId             = i.orderId;
                        deliveryVM.CustomerVMId          = i.customerId;
                        deliveryVM.CustomerVMName        = i.customerName;
                        deliveryVM.CustomerVMArea        = i.area;
                        deliveryVM.CustomerVMDistrict    = i.district;
                        deliveryVM.CustomerVMSubDistrict = i.subdistrict;
                        deliveryVM.CustomerVMHouseNo     = i.houseNo;
                        deliveryVM.CustomerVMRoadNo      = i.roadNo;
                        deliveryVM.CustomerVMContactNo   = i.contact;
                        deliveryVM.ShippingVMId          = i.shippingId;
                        deliveryVM.ShippingVMMethod      = i.shipping;
                        deliveryVM.PaymentVMId           = i.payementId;
                        deliveryVM.PaymentVMMethod       = i.payement;
                        deliveryVM.ProductVMId           = i.productId;
                        deliveryVM.OrderPlacedVMDate     = i.orderPlacedDate;
                        deliveryVM.productInventory_VM.productInventoryVMs.Add(productInventoryVM);
                    }
                    deliveryVMs.Add(deliveryVM);
                }
            }
            return(View(deliveryVMs));
        }
        public IActionResult AllOrderIndividualInfo(int id)
        {
            List <DeliveryVM> deliveryVMs = new List <DeliveryVM>();
            var detailsfromDelivery       = deliveryService.AllOrderListforIndividualInfofromDelivery(id);
            var detailsfromOrder          = orderService.AllOrderListforIndividualInfofromOrder(id);

            if (detailsfromDelivery.Count != 0)
            {
                var pass1 = from a in detailsfromDelivery
                            group a by a.Order.CustomerId into b
                            let c = (from d in b
                                     select new
                {
                    orderId = d.OrderId,
                    deliveryId = d.DeliveryId,
                    hiddenPkId = d.Order.HiddenPKId,
                    customerId = b.Key,
                    customerName = d.Order.Customer.CustomerName,
                    district = d.Order.Customer.District,
                    subdistrict = d.Order.Customer.SubDistrict,
                    area = d.Order.Customer.Area,
                    roadNo = d.Order.Customer.RoadNo,
                    houseNo = d.Order.Customer.HouseNo,
                    contact = d.Order.Customer.ContactNo,
                    shippingId = d.Order.ShippingId,
                    shipping = d.Order.Shipping.ShippingMethod,
                    payementId = d.Order.PaymentId,
                    payement = d.Order.Payment.PaymentMethod,
                    productId = d.Order.ProductInventoryId,
                    product = d.Order.ProductInventory.Name,
                    quantity = d.Order.Quantity,
                    totalPrice = d.Order.ProductInventory.SellPrice,
                    status = d.Status,
                    orderPlacedDate = d.Order.OrderDate,
                    orderDeliveredDate = d.DeliveredDate,
                    complaintDescription = d.ComplaintDescription
                })
                                    select c;
                ProductInventory_VM       productInventory_VM = new ProductInventory_VM();
                List <ProductInventoryVM> productInventoryVMs = new List <ProductInventoryVM>();
                foreach (var item in pass1)
                {
                    var deliveryVM = new DeliveryVM();
                    foreach (var i in item)
                    {
                        ProductInventoryVM productInventoryVM = new ProductInventoryVM();
                        productInventoryVM.NameVM        = i.product;
                        productInventoryVM.QuantityVM    = i.quantity;
                        productInventoryVM.EachPriceVM   = i.totalPrice * i.quantity;
                        deliveryVM.TotalPriceVM         += productInventoryVM.EachPriceVM;
                        productInventoryVM.StatusVM      = i.status;
                        deliveryVM.OrderVMId             = i.orderId;
                        deliveryVM.HiddenPKVMId          = i.hiddenPkId;
                        deliveryVM.CustomerVMId          = i.customerId;
                        deliveryVM.CustomerVMName        = i.customerName;
                        deliveryVM.CustomerVMArea        = i.area;
                        deliveryVM.CustomerVMDistrict    = i.district;
                        deliveryVM.CustomerVMSubDistrict = i.subdistrict;
                        deliveryVM.CustomerVMHouseNo     = i.houseNo;
                        deliveryVM.CustomerVMRoadNo      = i.roadNo;
                        deliveryVM.CustomerVMContactNo   = i.contact;
                        deliveryVM.ShippingVMId          = i.shippingId;
                        deliveryVM.ShippingVMMethod      = i.shipping;
                        deliveryVM.PaymentVMId           = i.payementId;
                        deliveryVM.PaymentVMMethod       = i.payement;
                        deliveryVM.ProductVMId           = i.productId;
                        deliveryVM.OrderPlacedVMDate     = i.orderPlacedDate;
                        deliveryVM.DeliveredVMDate       = i.orderDeliveredDate;
                        deliveryVM.productInventory_VM.productInventoryVMs.Add(productInventoryVM);
                    }
                    deliveryVMs.Add(deliveryVM);
                }
            }
            else if (detailsfromOrder.Count != 0)
            {
                var pass2 = from a in detailsfromOrder
                            group a by a.CustomerId into b
                            let c = (from d in b
                                     select new
                {
                    orderId = d.OrderId,
                    // deliveryId = d.DeliveryId,
                    hiddenPkId = d.HiddenPKId,
                    customerId = b.Key,
                    customerName = d.Customer.CustomerName,
                    district = d.Customer.District,
                    subdistrict = d.Customer.SubDistrict,
                    area = d.Customer.Area,
                    roadNo = d.Customer.RoadNo,
                    houseNo = d.Customer.HouseNo,
                    contact = d.Customer.ContactNo,
                    shippingId = d.ShippingId,
                    shipping = d.Shipping.ShippingMethod,
                    payementId = d.PaymentId,
                    payement = d.Payment.PaymentMethod,
                    productId = d.ProductInventoryId,
                    product = d.ProductInventory.Name,
                    quantity = d.Quantity,
                    totalPrice = d.ProductInventory.SellPrice,
                    status = d.Status,
                    orderPlacedDate = d.OrderDate,
                    //orderDeliveredDate = default(DateTime ?),
                })
                                    select c;
                ProductInventory_VM       productInventory_VM = new ProductInventory_VM();
                List <ProductInventoryVM> productInventoryVMs = new List <ProductInventoryVM>();
                foreach (var item in pass2)
                {
                    var deliveryVM = new DeliveryVM();
                    foreach (var i in item)
                    {
                        ProductInventoryVM productInventoryVM = new ProductInventoryVM();
                        //DateTime date1 = new DateTime(1855, 1, 1, 0, 0, 0, 0);
                        productInventoryVM.NameVM        = i.product;
                        productInventoryVM.QuantityVM    = i.quantity;
                        productInventoryVM.EachPriceVM   = i.totalPrice * i.quantity;
                        deliveryVM.TotalPriceVM         += productInventoryVM.EachPriceVM;
                        productInventoryVM.StatusVM      = i.status;
                        deliveryVM.OrderVMId             = i.orderId;
                        deliveryVM.HiddenPKVMId          = i.hiddenPkId;
                        deliveryVM.CustomerVMId          = i.customerId;
                        deliveryVM.CustomerVMName        = i.customerName;
                        deliveryVM.CustomerVMArea        = i.area;
                        deliveryVM.CustomerVMDistrict    = i.district;
                        deliveryVM.CustomerVMSubDistrict = i.subdistrict;
                        deliveryVM.CustomerVMHouseNo     = i.houseNo;
                        deliveryVM.CustomerVMRoadNo      = i.roadNo;
                        deliveryVM.CustomerVMContactNo   = i.contact;
                        deliveryVM.ShippingVMId          = i.shippingId;
                        deliveryVM.ShippingVMMethod      = i.shipping;
                        deliveryVM.PaymentVMId           = i.payementId;
                        deliveryVM.PaymentVMMethod       = i.payement;
                        deliveryVM.ProductVMId           = i.productId;
                        deliveryVM.OrderPlacedVMDate     = i.orderPlacedDate;
                        deliveryVM.DeliveredVMDate       = new DateTime(1900, 1, 1, 0, 0, 0, 0);
                        deliveryVM.productInventory_VM.productInventoryVMs.Add(productInventoryVM);
                    }
                    deliveryVMs.Add(deliveryVM);
                }
            }
            return(View(deliveryVMs));
        }
Example #22
0
        public IActionResult DeliveredOrderList(int?Page)  //delivered order list
        {
            var pageNumber = Page ?? 1;
            int pageSize   = 5;
            int sl         = 1;
            List <DeliveryVM> deliveryVMs = new List <DeliveryVM>();
            var orders = orderService.DeliveredOrderList();

            if (orders != null)
            {
                var pass = from a in orders
                           group a by new { a.Order.HiddenPKId } into b
                orderby b.Key.HiddenPKId
                let c = (from d in b
                         select new
                {
                    orderId = d.OrderId,
                    hiddenPKId = b.Key.HiddenPKId,
                    customerId = d.Order.CustomerId,
                    customerName = d.Order.Customer.CustomerName,
                    area = d.Order.Customer.Area,
                    contact = d.Order.Customer.ContactNo,
                    shippingId = d.Order.ShippingId,
                    shipping = d.Order.Shipping.ShippingMethod,
                    payementId = d.Order.PaymentId,
                    payement = d.Order.Payment.PaymentMethod,
                    productId = d.Order.ProductInventoryId,
                    product = d.Order.ProductInventory.Name,
                    quantity = d.Order.Quantity,
                    totalPrice = d.Order.ProductInventory.SellPrice,
                    status = d.Status,
                    orderPlacedDate = d.Order.OrderDate,
                    orderDeliveredDate = d.DeliveredDate,
                })
                        select c;
                ProductInventory_VM       productInventory_VM = new ProductInventory_VM();
                List <ProductInventoryVM> productInventoryVMs = new List <ProductInventoryVM>();
                foreach (var item in pass)
                {
                    var deliveryVM = new DeliveryVM();

                    foreach (var i in item)
                    {
                        ProductInventoryVM productInventoryVM = new ProductInventoryVM();
                        productInventoryVM.NameVM      = i.product;
                        productInventoryVM.QuantityVM  = i.quantity;
                        productInventoryVM.EachPriceVM = i.totalPrice * i.quantity;
                        deliveryVM.TotalPriceVM       += productInventoryVM.EachPriceVM;
                        productInventoryVM.StatusVM    = i.status;
                        deliveryVM.SerialNo            = sl;
                        deliveryVM.OrderVMId           = i.orderId;
                        deliveryVM.CustomerVMId        = i.customerId;
                        deliveryVM.CustomerVMName      = i.customerName;
                        deliveryVM.CustomerVMArea      = i.area;
                        deliveryVM.CustomerVMContactNo = i.contact;
                        deliveryVM.ShippingVMId        = i.shippingId;
                        deliveryVM.ShippingVMMethod    = i.shipping;
                        deliveryVM.PaymentVMId         = i.payementId;
                        deliveryVM.PaymentVMMethod     = i.payement;
                        deliveryVM.ProductVMId         = i.productId;
                        if (orderService.GetDeliveryInfobyOrderId(i.orderId) != null)
                        {
                            if (orderService.GetTrueStatusDeliveryInfobyOrderId(i.orderId) != null)
                            {
                                deliveryVM.StatusVM       = true;
                                deliveryVM.StringStatusVM = "Delivered";
                            }
                            //else if (orderService.GetFalseStatusDeliveryInfobyOrderId(i.orderId) != null)
                            //{
                            //    deliveryVM.StatusVM = true;
                            //    deliveryVM.StringStatusVM = "To-be delivered";
                            //}
                            //else
                            //{
                            //    deliveryVM.StatusVM = false;
                            //    deliveryVM.StringStatusVM = "Pending";
                            //}
                        }
                        //else
                        //{
                        //    deliveryVM.StatusVM = false;
                        //    deliveryVM.StringStatusVM = "Pending";
                        //}
                        deliveryVM.OrderPlacedVMDate = i.orderPlacedDate;
                        deliveryVM.DeliveredVMDate   = i.orderDeliveredDate;
                        deliveryVM.productInventory_VM.productInventoryVMs.Add(productInventoryVM);
                    }
                    deliveryVMs.Add(deliveryVM);
                    sl++;
                }
            }
            return(View(deliveryVMs.ToPagedList(pageNumber, pageSize)));
        }
Example #23
0
 public Payment(CartVM vm, DeliveryVM vm1)
 {
     cart        = vm;
     DataContext = new PaymentVM(cart, vm1);
     InitializeComponent();
 }