예제 #1
0
        /// <summary>
        /// View Controller untuk barang tiba
        /// </summary>
        /// <param name="po">Kode PO</param>
        /// <returns>Model PO Delivered</returns>
        public ActionResult DeliveredBoard(string po)
        {
            try
            {
                ViewBag.useIcheck    = true;
                ViewBag.useDataTable = true;
                ViewBag.po           = po;
                ViewBag.addDelivered = false;

                // status kedatangan barang
                // F = full, P = partial, N = none
                ViewBag.full    = "F";
                ViewBag.partial = "P";
                ViewBag.none    = "N";

                if (User.IsInRole(PENERIMABARANG) || User.IsInRole(DEVELOPER))
                {
                    ViewBag.addDelivered = true;
                }

                if (po != null && po != "")
                {
                    PoTransactions pt = new PoTransactions(po);
                    ViewBag.created = pt.getDatePublish();
                    var model = pt.getProductDelivered();
                    if (model != null)
                    {
                        ViewBag.dpb = pt.getDpb();
                        DeliveredInfo di = pt.getDeliveredInfo();
                        ViewBag.note   = di.note;
                        ViewBag.status = di.status;
                        return(View(model));
                    }
                }
                ViewBag.noData = true;
                return(View());
            }
            catch (Exception e)
            {
                Log.Error(e);
                ViewBag.useIcheck    = true;
                ViewBag.useDataTable = true;
                ViewBag.po           = po;
                ViewBag.addDelivered = false;

                // status kedatangan barang
                // F = full, P = partial, N = none
                ViewBag.full    = "F";
                ViewBag.partial = "P";
                ViewBag.none    = "N";
                ViewBag.noData  = true;
                return(View());
            }
        }