public frmManifestGenerator(UMDAppConfig config, Logger log)
 {
     logger = log;
     Init(config);
     InitializeComponent();
     // ViewModel Instance
     mvm = new ManifestVM(config);
 }
Exemplo n.º 2
0
        public JsonResult GetManifest(DateTime tdate)
        {
            string            view = "";
            List <ManifestVM> lst  = new List <ManifestVM>();

            var data = db.InScans.Where(x => x.InScanDate == tdate).ToList();

            foreach (var item in data)
            {
                ManifestVM v = new ManifestVM();
                v.Shipper     = item.Consignor;
                v.date        = item.InScanDate;
                v.awbno       = item.AWBNo;
                v.consignee   = item.Consignee;
                v.destination = item.Destination;
                v.noofpcs     = Convert.ToInt32(item.Pieces);
                v.weight      = item.StatedWeight.Value;

                int i = (from c in db.ParcelTypes where c.ID == item.ParcelTypeID select c.ParcelTypeID).FirstOrDefault().Value;

                string type = "";
                if (i == 0)
                {
                    type = "Non Docs";
                }
                else
                {
                    type = "Docs";
                }
                v.type     = type;
                v.contents = item.CargoDescription;
                v.remark   = item.Remarks;

                lst.Add(v);
            }

            view = this.RenderPartialView("ucManifest", lst);



            //var data = from t in db.AcJournalMasters select t;

            return(new JsonResult
            {
                Data = new
                {
                    success = true,
                    view = view
                },
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }