Exemple #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));
        }
Exemple #2
0
 public ActionResult AdvSearch()
 {
     ViewBag.ContainerList = ListCommonHelper.GetContainerList();
     ViewBag.ShipperList   = ListCommonHelper.GetShipperList();
     ViewBag.ConsigneeList = ListCommonHelper.GetConsigneeList();
     ViewData["PortList"]  = ListCommonHelper.GetPortsGrouped();
     return(PartialView("~/Views/CustomClearance/_AdvSearch.cshtml"));
 }
        public ActionResult Index()
        {
            ViewBag.ContractorList = ListCommonHelper.GetContractorList();
            ViewData["AreaList"]   = ListCommonHelper.GetAreaGrouped();
            ViewBag.ContainerList  = ListCommonHelper.GetContainerList();

            return(View());
        }
 public ActionResult Index()
 {
     ViewBag.CarrierList   = ListCommonHelper.GetCarrierList();
     ViewData["PortList"]  = ListCommonHelper.GetPortsGrouped();
     ViewBag.ContainerList = ListCommonHelper.GetContainerList();
     // var carrRateList = CarrierRateHelper.GetCarrierRatesList(true);
     return(View());
 }
 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"));
 }
        /// <summary>
        /// Load add container partial view based on operationtype
        /// </summary>
        /// <param name="operationId"></param>
        /// <param name="carrierType"></param>
        /// <returns></returns>
        public ActionResult GetOperationContainers(int operationId, byte carrierType)
        {
            List <OperationContainerVm> operContainerList = OperationHelper.GetOperationContainers(operationId);

            ViewBag.ContainerList = ListCommonHelper.GetContainerList();
            ViewBag.PackageList   = ListCommonHelper.GetPackageTypeList();
            if (carrierType == 1)//sea
            {
                return(PartialView("~/Views/Operation/_AddContainer.cshtml", operContainerList));
            }
            else
            {
                return(PartialView("~/Views/Operation/_AddContainerAir.cshtml", operContainerList));
            }
        }
Exemple #7
0
        public ActionResult Add(int id = 0, byte orderFrom = 1)
        {
            #region Check Rights
            bool hasRights;
            if (orderFrom == 1) //Check export rights
            {
                if (id == 0)
                {
                    hasRights = AdminHelper.CheckUserAction(ScreenEnum.ExportQuotation, ActionEnum.Add);
                }
                else
                {
                    hasRights = AdminHelper.CheckUserAction(ScreenEnum.ExportQuotation, ActionEnum.Edit);
                }
            }
            else
            {
                if (id == 0)
                {
                    hasRights = AdminHelper.CheckUserAction(ScreenEnum.ImportQuotation, ActionEnum.Add);
                }
                else
                {
                    hasRights = AdminHelper.CheckUserAction(ScreenEnum.ImportQuotation, ActionEnum.Edit);
                }
            }


            if (!hasRights)
            {
                return(RedirectToAction("UnAuthorized", "Home"));
            }
            #endregion

            QuotationVm quotationsVm = QuotationHelper.GetQuotationInfo(id, orderFrom);

            ViewBag.CarrierList      = ListCommonHelper.GetCarrierList("en", 1);
            ViewBag.ShipperList      = ListCommonHelper.GetShipperList();
            ViewBag.ConsigneeList    = ListCommonHelper.GetConsigneeList();
            ViewBag.NotifierList     = ListCommonHelper.GetNotifierList(0);
            ViewBag.IncotermLib      = ListCommonHelper.GetIncotermLibList();
            ViewBag.Containers       = ListCommonHelper.GetContainerList();
            ViewData["PortList"]     = ListCommonHelper.GetPortsGrouped("en", 1);
            ViewData["CurrencyList"] = ListCommonHelper.GetCurrencyList();
            ViewBag.AgentList        = ListCommonHelper.GetAgentList();

            return(View(quotationsVm));
        }
        /// <summary>
        /// Get house bill .. in case of no house bills .. will fill its view model from operation data
        /// </summary>
        /// <param name="operationId"> int Operation Id </param>
        /// <param name="oprOrderFrom">byte Order From</param>
        /// <returns></returns>
        public ActionResult GetHbContent(int operationId, byte oprOrderFrom, int hbId = 0)
        {
            #region Check Rights
            bool hasRights;
            if (oprOrderFrom == 1) //Check export rights
            {
                if (hbId == 0)
                {
                    hasRights = AdminHelper.CheckUserAction(ScreenEnum.ExportHB, ActionEnum.Add);
                }
                else
                {
                    hasRights = AdminHelper.CheckUserAction(ScreenEnum.ExportHB, ActionEnum.Edit);
                }
            }
            else
            {
                if (hbId == 0)
                {
                    hasRights = AdminHelper.CheckUserAction(ScreenEnum.ImportHB, ActionEnum.Add);
                }
                else
                {
                    hasRights = AdminHelper.CheckUserAction(ScreenEnum.ImportHB, ActionEnum.Edit);
                }
            }

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

            #endregion
            HouseBillVm houseBillVm = HouseBillHelper.GetHbContent(operationId, oprOrderFrom, hbId);
            ViewBag.ShipperList      = ListCommonHelper.GetShipperList();
            ViewBag.ConsigneeList    = ListCommonHelper.GetConsigneeList();
            ViewBag.IncotermLib      = ListCommonHelper.GetIncotermLibList();
            ViewBag.Containers       = ListCommonHelper.GetContainerList();
            ViewBag.PackageList      = ListCommonHelper.GetPackageTypeList();
            ViewData["PortList"]     = ListCommonHelper.GetPortsGrouped();
            ViewData["CurrencyList"] = ListCommonHelper.GetCurrencyList();
            ViewBag.AgentList        = ListCommonHelper.GetAgentList();
            ViewBag.OperationVm      = OperationHelper.GetOperationInfo(operationId);
            ViewBag.OperContainers   = OperationHelper.GetOperationContainers(operationId);
            ViewBag.SelectedHbCon    = HouseBillHelper.GetHousContainerByHouseID(hbId);
            ViewBag.NotifierList     = ListCommonHelper.GetNotifierList(0);
            return(PartialView("~/Views/Operation/_HouseBill.cshtml", houseBillVm));
        }
        /// <summary>
        /// Add export or import MBL operation
        /// </summary>
        /// <param name="orderFrom"> export --- import</param>
        /// <param name="id">operation id to load edit mode view</param>
        /// <param name="quoteId">quotation id in case of processing an exsiting quotation</param>
        /// <returns>the add operation view</returns>
        public ActionResult Add(string orderFrom = "export", int id = 0, int quoteId = 0)
        {
            #region Check Rights
            bool hasRights;
            if (orderFrom.ToLower() == "export") //Check export rights
            {
                if (quoteId != 0)                //process quotation check
                {
                    hasRights = AdminHelper.CheckUserAction(ScreenEnum.ExportQuotation, ActionEnum.ProcessToMBL);
                }
                else
                {
                    if (id == 0)
                    {
                        hasRights = AdminHelper.CheckUserAction(ScreenEnum.ExportMBL, ActionEnum.Add);
                    }
                    else
                    {
                        hasRights = AdminHelper.CheckUserAction(ScreenEnum.ExportMBL, ActionEnum.Edit);
                    }
                }
            }
            else
            {
                if (quoteId != 0) //process quotation check
                {
                    hasRights = AdminHelper.CheckUserAction(ScreenEnum.ImportQuotation, ActionEnum.ProcessToMBL);
                }
                else
                {
                    if (id == 0)
                    {
                        hasRights = AdminHelper.CheckUserAction(ScreenEnum.ImportMBL, ActionEnum.Add);
                    }
                    else
                    {
                        hasRights = AdminHelper.CheckUserAction(ScreenEnum.ImportMBL, ActionEnum.Edit);
                    }
                }
            }

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

            #endregion

            byte orderFromInt = 0;
            if (orderFrom.ToLower() == "export")
            {
                ViewBag.OperationType = "Export";
                orderFromInt          = 1;
            }
            else if (orderFrom.ToLower() == "import")
            {
                ViewBag.OperationType = "Import";
                orderFromInt          = 2;
            }
            else
            {
                //Error Page
            }


            OperationVm operationVm = OperationHelper.GetOperationInfo(id, orderFromInt, quoteId);

            ViewBag.CarrierList      = ListCommonHelper.GetCarrierList();
            ViewBag.ShipperList      = ListCommonHelper.GetShipperList();
            ViewBag.ConsigneeList    = ListCommonHelper.GetConsigneeList();
            ViewBag.NotifierList     = ListCommonHelper.GetNotifierList(0);
            ViewBag.IncotermLib      = ListCommonHelper.GetIncotermLibList();
            ViewBag.Containers       = ListCommonHelper.GetContainerList();
            ViewBag.PackageList      = ListCommonHelper.GetPackageTypeList();
            ViewData["PortList"]     = ListCommonHelper.GetPortsGrouped();
            ViewData["CurrencyList"] = ListCommonHelper.GetCurrencyList();
            ViewBag.AgentList        = ListCommonHelper.GetAgentList();

            return(View(operationVm));
        }