Пример #1
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));
        }
Пример #2
0
        public ActionResult Add(int id = 0)
        {
            #region Check Rights
            bool hasRights;
            if (id == 0) //Check export rights
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.Consignee, ActionEnum.Add);
            }
            else
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.Consignee, ActionEnum.Edit);
            }

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

            #endregion

            ViewData["CityList"] = ListCommonHelper.GetCityGrouped();
            ConsigneeVm consigneeObj = ConsigneeHelper.GetConsigneeInfo(id);
            return(View(consigneeObj));
        }