public ActionResult PrintHBDetailsV(int houseBillId = 1033)
        {
            var hbView = HouseBillHelper.GetHBView(houseBillId);
            int id     = hbView.OperationId;

            EasyFreight.Models.OperationView quoteView = OperationHelper.GetOne(id);
            ViewData["CurrecyList"] = ListCommonHelper.GetCurrencyList();
            ViewBag.QuoteContainers = OperationHelper.GetOperationContainers(id);
            ViewData["StaticText"]  = CommonHelper.GetStaticTextById(1);

            //if (quoteView.IsCareOf)
            //{
            //    CompanySetupVm company = CompanySetupHelper.GetCompanySetup();
            //    ViewBag.ShipperAddress = company.CompanyAddressEn;
            //    ViewBag.ShipperTel = (!string.IsNullOrEmpty(company.PhoneNumber1) ? " Tel. " + company.PhoneNumber1 : "") +
            //        (!string.IsNullOrEmpty(company.FaxNumber) ? "  Fax. " + company.FaxNumber : "");
            //}
            //else
            //{
            ViewBag.ShipperAddress = quoteView.ShipperAddressEn;
            ViewBag.ShipperTel     = (!string.IsNullOrEmpty(quoteView.ShipperPhoneNumber) ? " Tel. " + quoteView.ShipperPhoneNumber : "") +
                                     (!string.IsNullOrEmpty(quoteView.ShipperFaxNumber) ? " Fax. " + quoteView.ShipperPhoneNumber : "");
            //}



            return(View(hbView));
        }
        public ActionResult PrintHBCostV(HouseBillListVm hbObj)
        {
            ViewBag.HbObj = hbObj;
            OperationCostMainVm hbCostView = HouseBillHelper.GetHBCost(hbObj.HouseBillId, 0);

            return(View(hbCostView));
        }
Beispiel #3
0
        /// <summary>
        /// operation employee add custom clearance order from process operation order
        /// </summary>
        /// <param name="id">Operation Id</param>
        /// <returns>add custom clearance order patial view</returns>
        public ActionResult CustomClearanceOrder(int id, int houseBillId, byte orderFrom)
        {
            #region Check Rights
            bool hasRights;
            if (orderFrom == 1) //Check export rights
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.ExportHB, ActionEnum.AddEditCCOrder);
            }
            else
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.ImportHB, ActionEnum.AddEditCCOrder);
            }

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

            #endregion

            ViewBag.customClearObj = CustomClearanceHelper.GetCustomClearance(id, houseBillId);
            EasyFreight.Models.HouseBillView operationView = HouseBillHelper.GetHBView(houseBillId);
            ViewBag.ContainerSummary = OperationHelper.GetContainersSummary(id);
            return(PartialView("~/Views/CustomClearance/_CustomClearance.cshtml", operationView));
        }
        public ActionResult GetHbList(int operationId, byte oprOrderFrom)
        {
            var hbList = HouseBillHelper.GetHBList(operationId, oprOrderFrom);

            TempData["hbList"]      = hbList;
            ViewBag.IsConsolidation = OperationHelper.CheckOperationIsConsolidation(operationId);
            ViewBag.OrderFrom       = oprOrderFrom;
            return(PartialView("~/Views/Operation/_HouseBillList.cshtml", hbList));
        }
        public ActionResult GetHBCost(int houseBillId, int operationId)
        {
            ViewBag.OperationCostNameList = ListCommonHelper.GetOperationCostList();
            ViewBag.CurrencyList          = ListCommonHelper.GetCurrencyList();
            ViewBag.HbObj       = ((List <HouseBillListVm>)TempData["hbList"]).Where(x => x.HouseBillId == houseBillId).FirstOrDefault();
            Session["hbOneObj"] = ((List <HouseBillListVm>)TempData["hbList"]).Where(x => x.HouseBillId == houseBillId).FirstOrDefault();
            OperationCostMainVm hbCostAdd = HouseBillHelper.GetHBCost(houseBillId, operationId);

            return(PartialView("~/Views/Operation/_OperationCost.cshtml", hbCostAdd));
        }
Beispiel #6
0
        public ActionResult PreAlertLetter(int houseBillId, int isNotifier = 0)
        {
            HouseBillView hbill       = HouseBillHelper.GetHBView(houseBillId);
            int           operationID = hbill.OperationId;
            OperationView operation   = OperationHelper.GetOne(operationID);

            ViewBag.houseBL   = hbill.HouseBL;
            ViewBag.isNotifie = isNotifier;
            return(View(hbill));           //operation
        }
Beispiel #7
0
        public ActionResult AddOperationCost(int hbId)
        {
            ViewBag.OperationCostNameList = ListCommonHelper.GetOperationCostList();
            ViewBag.CurrencyList          = ListCommonHelper.GetCurrencyList();

            ViewBag.HbObj = HouseBillHelper.GetHbContent(hbId);
            // Session["hbOneObj"] = ((List<HouseBillListVm>)TempData["hbList"]).Where(x => x.HouseBillId == hbId).FirstOrDefault();

            OperationCostMainVm hbCostAdd = HouseBillHelper.GetHBCost(hbId);

            return(View(hbCostAdd));
        }
        /// <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));
        }
        public ActionResult AddHbContainer(List <int> data, int hbID, int operationId)
        {
            string           isSaved = "";
            HouseContainerVm hcv     = new HouseContainerVm();

            hcv.HouseBillId = hbID;
            hcv.OperationId = operationId;
            hcv.OperConId   = 0;

            HouseBillHelper.DeleteByHouseContainer(hcv);
            foreach (var item in data)
            {
                hcv.OperConId = item;
                HouseBillHelper.CreateHouseContainer(hcv);
            }
            return(Json(isSaved));
        }
        /// <summary>
        /// The main view to process MBL .. it contains the all tabs
        /// </summary>
        /// <param name="orderFrom">export --- import</param>
        /// <param name="id">Operation Id</param>
        /// <returns>HouseBill with tabs</returns>
        public ActionResult HouseBill(string orderFrom, int id)
        {
            #region Check Rights
            bool hasRights;
            if (orderFrom.ToLower() == "export") //Check export rights
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.ExportMBL, ActionEnum.ProcessToHB);
            }
            else
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.ImportMBL, ActionEnum.ProcessToHB);
            }

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

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


            EasyFreight.Models.OperationView operationView = OperationHelper.GetOne(id);
            TempData["OperationObj"] = operationView;
            ViewData["CurrecyList"]  = ListCommonHelper.GetCurrencyList();
            ViewBag.OperContainers   = OperationHelper.GetOperationContainers(id);
            ViewBag.HBCount          = HouseBillHelper.GetHBCount(id);
            //ViewBag.TruckingCount = TruckingHelper.GetTruckingOrdersCount(id);
            return(View(operationView));
        }
        /// <summary>
        /// Close House bill order
        /// </summary>
        /// <param name="hbId">HouseBillId</param>
        /// <returns>true is succeed</returns>
        public ActionResult CloseHB(int hbId, byte orderFrom = 1)
        {
            #region Check Rights
            bool hasRights;
            if (orderFrom == 1) //Check export rights
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.ExportHB, ActionEnum.CloseOrder);
            }
            else
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.ImportHB, ActionEnum.CloseOrder);
            }

            if (!hasRights)
            {
                return(Json("You are UnAuthorized to do this action"));
            }

            #endregion
            string isClosed = HouseBillHelper.ChangeHBStatus(hbId, (int)StatusEnum.Closed);
            return(Json(isClosed));
        }
Beispiel #12
0
        public ActionResult ManageOrder(int id, byte orderFrom)
        {
            if (orderFrom == 1)
            {
                ViewBag.OperationType = "Export";
            }
            else
            {
                ViewBag.OperationType = "Import";
            }

            ViewBag.OperationId = id;

            var invList = InvoiceHelper.GetInvoiceListForOper(id);

            var hbList = HouseBillHelper.GetHBList(id, orderFrom, true);

            ViewBag.OperationCode = hbList.FirstOrDefault().OperationCode;
            ViewBag.HbList        = hbList;


            return(View(invList));
        }
Beispiel #13
0
        public ActionResult DeliveryNoteAr(int hbId)
        {
            var concLetter = HouseBillHelper.GetDeliveryNoteInfo(hbId, "ar");

            return(View(concLetter));
        }
Beispiel #14
0
        /// <summary>
        /// Expand table row.. Get HB for operation
        /// </summary>
        /// <param name="operationId">operation id</param>
        /// <param name="orderFrom">1 export or 2 import</param>
        /// <returns></returns>
        public ActionResult GetHbList(int operationId, byte orderFrom)
        {
            var hbList = HouseBillHelper.GetHBList(operationId, orderFrom, true);

            return(PartialView("~/Views/Accounting/_HouseBillList.cshtml", hbList));
        }
        public ActionResult AddEditAccountHbCost(OperationCostMainVm operCostMainVm)
        {
            string isSaved = HouseBillHelper.AddEditAccountHbCost(operCostMainVm);

            return(Json(isSaved));
        }
        /// <summary>
        /// Get One record from HB view to view in the modal
        /// </summary>
        /// <param name="houseBillId">House bill Id</param>
        /// <returns>_ViewHouseBill partial view</returns>
        public ActionResult GetHBForView(int houseBillId)
        {
            var hbView = HouseBillHelper.GetHBView(houseBillId);

            return(PartialView("~/Views/Operation/_ViewHouseBill.cshtml", hbView));
        }
        /// <summary>
        /// The post action to save House Bill data
        /// </summary>
        /// <param name="houseBillVm">House Bill view model object</param>
        /// <returns>string "true" or "false + error message"</returns>
        public ActionResult AddEditHouseBill(HouseBillVm houseBillVm)
        {
            string isSaved = HouseBillHelper.AddEditHouseBill(houseBillVm);

            return(Json(isSaved));
        }