Ejemplo n.º 1
0
        //
        // GET: /ReceiveDetail/Create

        public virtual ActionResult Create()
        {
            ViewBag.CommodityID      = new SelectList(_commodityService.GetAllCommodity(), "CommodityID", "Name");
            ViewBag.CommodityGradeID = new SelectList(_commodityGradeService.GetAllCommodityGrade(), "CommodityGradeID", "Name");
            ViewBag.ReceiveID        = new SelectList(_receiveService.GetAllReceive(), "ReceiveID", "SINumber");
            ViewBag.UnitID           = new SelectList(_unitService.GetAllUnit(), "UnitID", "Name");
            return(View());
        }
Ejemplo n.º 2
0
        // DRMFSS.BLL.CTSContext db = new BLL.CTSContext();
        public virtual ActionResult SIReport(string siNumber)
        {
            if (!string.IsNullOrEmpty(siNumber))
            {
                // TODO: redo this report
                var dispatches = from dis in _dispatchService.GetAllDispatch()
                                 where dis.DispatchDetails.FirstOrDefault().ToString() == siNumber.Trim()
                                 select dis;

                // TODO: redo this report
                var recieves = from res in _receiveService.GetAllReceive()
                               where res.ReceiveDetails.FirstOrDefault().TransactionGroup.Transactions.FirstOrDefault().ShippingInstruction.Value == siNumber.Trim()
                               select res;

                Models.SIReportModel model = new Models.SIReportModel();
                foreach (BLL.Dispatch p in dispatches)
                {
                    foreach (BLL.DispatchDetail com in p.DispatchDetails)
                    {
                        Models.TransactedStock dis = new Models.TransactedStock();
                        dis.Warehouse = p.Hub.Name;
                        //dis.Store = p.Store.Name;
                        dis.GIN       = p.GIN;
                        dis.Commodity = com.Commodity.Name;
                        dis.Date      = p.DispatchDate;
                        dis.FDP       = p.FDP.Name;
                        //dis.Quantity = com.DispatchedQuantityInMT;
                        dis.Region = p.FDP.AdminUnit.AdminUnit2.AdminUnit2.Name;
                        dis.Woreda = p.FDP.AdminUnit.Name;
                        dis.Zone   = p.FDP.AdminUnit.AdminUnit2.Name;
                        model.Dispatched.Add(dis);
                    }
                }
                foreach (BLL.Receive p in recieves)
                {
                    foreach (BLL.ReceiveDetail com in p.ReceiveDetails)
                    {
                        Models.TransactedStock dis = new Models.TransactedStock();
                        dis.Warehouse = p.Hub.Name;
                        //dis.Store = p.Store.Name;
                        dis.GRN       = p.GRN;
                        dis.Commodity = com.Commodity.Name;
                        dis.Date      = p.ReceiptDate;
                        //dis.Quantity = com.ReceivedQuantityInMT;
                        model.Recieved.Add(dis);
                    }
                }
                return(View(model));
            }
            return(View(new Models.SIReportModel()));
        }