Example #1
0
        public ActionResult Add(int id = 0)
        {
            #region Check Rights
            bool hasRights;
            if (id == 0) //Check export rights
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.ContractorRate, ActionEnum.Add);
            }
            else
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.ContractorRate, ActionEnum.Edit);
            }

            if (!hasRights)
            {
                return(RedirectToAction("UnAuthorized", "Home", new { area = "" }));
            }

            #endregion

            ContractorRateVm carrRateVm = ContractorRateHelper.GetContractorRateInfo(id);
            ViewBag.ContractorList   = ListCommonHelper.GetContractorList();
            ViewBag.ContainerList    = ListCommonHelper.GetContainerList();
            ViewData["AreaList"]     = ListCommonHelper.GetAreaGrouped();
            ViewData["CityList"]     = ListCommonHelper.GetCityGrouped();
            ViewData["CurrencyList"] = ListCommonHelper.GetCurrencyList();
            return(View(carrRateVm));
        }
        public ActionResult Index()
        {
            ViewBag.ContractorList = ListCommonHelper.GetContractorList();
            ViewData["AreaList"]   = ListCommonHelper.GetAreaGrouped();
            ViewBag.ContainerList  = ListCommonHelper.GetContainerList();

            return(View());
        }
Example #3
0
 public ActionResult AdvSearch()
 {
     ViewBag.ContractorList = ListCommonHelper.GetContractorList();
     ViewBag.ContainerList  = ListCommonHelper.GetContainerList();
     ViewBag.ShipperList    = ListCommonHelper.GetShipperList();
     ViewBag.ConsigneeList  = ListCommonHelper.GetConsigneeList();
     ViewData["AreaList"]   = ListCommonHelper.GetAreaGrouped();
     return(PartialView("~/Views/Trucking/_AdvSearch.cshtml"));
 }
Example #4
0
        public ActionResult AddTruckingOrder(int operationId, byte orderFrom = 1, int houseBillId = 0)
        {
            #region Check Rights
            bool hasRights;
            if (orderFrom == 1) //Check export rights
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.ExportHB, ActionEnum.AddEditTruckingOrder);
            }
            else
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.ImportHB, ActionEnum.AddEditTruckingOrder);
            }

            if (!hasRights)
            {
                return(PartialView("~/Views/Shared/_UnAuthorized.cshtml"));
            }

            #endregion

            // remember that cannot create more than one tracking order unless status canceled

            TruckingOrderVm trkoVmObj = TruckingHelper.NewTruckingOrderByOperation(operationId, orderFrom, houseBillId);
            if (trkoVmObj.OrderFrom == 1)
            {
                var shipperObj = ShipperHelper.GetShipperInfo(trkoVmObj.ShipperId);
                ViewBag.ClientName        = shipperObj.ShipperNameEn;
                trkoVmObj.ShipFromAddress = shipperObj.ShipperAddressEn;
            }
            else
            {
                var consigneeObj = ConsigneeHelper.GetConsigneeInfo(trkoVmObj.ConsigneeId);
                ViewBag.ClientName        = consigneeObj.ConsigneeNameEn;
                trkoVmObj.ShipFromAddress = consigneeObj.ConsigneeAddressEn;
            }

            ViewData["AreaList"]     = ListCommonHelper.GetAreaGrouped();
            ViewBag.ContainerSummary = OperationHelper.GetContainersSummary(trkoVmObj.OperationId);

            return(PartialView("~/Views/Trucking/AddTruckingOrder.cshtml", trkoVmObj));
        }