Exemplo n.º 1
0
        public ActionResult AddDeliveryChallanDetail()
        {
            DeliveryChallanDetailViewModel deliveryChallanDetailVM = new DeliveryChallanDetailViewModel();

            deliveryChallanDetailVM.IsUpdate   = false;
            deliveryChallanDetailVM.OrderQty   = 0;
            deliveryChallanDetailVM.DelvQty    = 0;
            deliveryChallanDetailVM.PrevDelQty = 0;
            return(PartialView("_AddDeliveryChallanDetail", deliveryChallanDetailVM));
        }
Exemplo n.º 2
0
        public string GetDeliveryChallanDetailListByDeliveryChallanID(Guid deliveryChallanID)
        {
            try
            {
                List <DeliveryChallanDetailViewModel> deliveryChallanItemViewModelList = new List <DeliveryChallanDetailViewModel>();
                if (deliveryChallanID == Guid.Empty)
                {
                    DeliveryChallanDetailViewModel deliveryChallanDetailVM = new DeliveryChallanDetailViewModel()
                    {
                        ID             = Guid.Empty,
                        DelvChallanID  = Guid.Empty,
                        ProductID      = Guid.Empty,
                        ProductModelID = Guid.Empty,
                        ProductSpec    = string.Empty,
                        OrderQty       = 0,
                        DelvQty        = 0,
                        PrevDelQty     = 0,
                        Unit           = new UnitViewModel()
                        {
                            Code        = 0,
                            Description = string.Empty,
                        },

                        Product = new ProductViewModel()
                        {
                            ID   = Guid.Empty,
                            Code = string.Empty,
                            Name = string.Empty,
                        },
                        ProductModel = new ProductModelViewModel()
                        {
                            ID   = Guid.Empty,
                            Name = string.Empty
                        },
                    };
                    deliveryChallanItemViewModelList.Add(deliveryChallanDetailVM);
                }
                else
                {
                    deliveryChallanItemViewModelList = Mapper.Map <List <DeliveryChallanDetail>, List <DeliveryChallanDetailViewModel> >(_deliveryChallanBusiness.GetDeliveryChallanDetailListByDeliveryChallanID(deliveryChallanID));
                }
                return(JsonConvert.SerializeObject(new { Status = "OK", Records = deliveryChallanItemViewModelList, Message = "Success" }));
            }
            catch (Exception ex)
            {
                AppConstMessage cm = _appConstant.GetMessage(ex.Message);
                return(JsonConvert.SerializeObject(new { Status = "ERROR", Records = "", Message = cm.Message }));
            }
        }