public ActionResult CityLibrary()
        {
            var citiesList = LibraryCommonHelper.GetCitiesListByCountryId(0);

            ViewData["CountryList"] = ListCommonHelper.GetCountryList();
            return(View(citiesList));
        }
        public ActionResult AreaLibrary()
        {
            var areasList = LibraryCommonHelper.GetAreasListByCityId(0);

            ViewData["CityList"] = ListCommonHelper.GetCityGrouped();
            return(View(areasList));
        }
        public ActionResult PortLibrary()
        {
            var portsList = LibraryCommonHelper.GetPortsListByCityId(0);

            ViewData["CityList"] = ListCommonHelper.GetCityGrouped();
            return(View(portsList));
        }
        public ActionResult AddEditCity(EasyFreight.Models.City cityDb)
        {
            #region Check Rights
            bool hasRights;
            if (cityDb.CityId == 0) //Check export rights
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.CitiesLibrary, ActionEnum.Add);
            }
            else
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.CitiesLibrary, ActionEnum.Edit);
            }

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

            #endregion
            string isSaved = LibraryCommonHelper.AddEditCities(cityDb);
            if (isSaved != "true")
            {
                return(Json(isSaved));
            }
            var citiesList = LibraryCommonHelper.GetCitiesListByCountryId(0);
            return(PartialView("~/Areas/MasterData/Views/CountryLibrary/_CityTable.cshtml", citiesList));
        }
Example #5
0
        public ActionResult DeletePackageType(int packageTypeId)
        {
            #region Check Rights
            bool hasRights = false;
            hasRights = AdminHelper.CheckUserAction(ScreenEnum.PackagesTypes, ActionEnum.Delete);
            if (!hasRights)
            {
                return(Json("You are UnAuthorized to do this action"));
            }

            #endregion
            return(Json(LibraryCommonHelper.DeletePackageType(packageTypeId)));
        }
        public ActionResult DeleteCountry(int countryId)
        {
            #region Check Rights
            bool hasRights = false;
            hasRights = AdminHelper.CheckUserAction(ScreenEnum.CountriesLibrary, ActionEnum.Delete);
            if (!hasRights)
            {
                return(Json("You are UnAuthorized to do this action"));
            }

            #endregion
            return(Json(LibraryCommonHelper.DeleteCountry(countryId)));
        }
        public ActionResult DeleteArea(int areaId)
        {
            #region Check Rights
            bool hasRights = false;
            hasRights = AdminHelper.CheckUserAction(ScreenEnum.AreasLibrary, ActionEnum.Delete);
            if (!hasRights)
            {
                return(Json("You are UnAuthorized to do this action"));
            }

            #endregion
            string isDeleted = LibraryCommonHelper.DeleteArea(areaId);
            return(Json(isDeleted));
        }
Example #8
0
        public ActionResult AddEditContainerType(int containerTypeId, string containerTypeName, string maxCBM, string maxWeight)
        {
            #region Check Rights
            bool hasRights = false;
            if (containerTypeId == 0)
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.ContainersTypes, ActionEnum.Add);
            }
            else
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.ContainersTypes, ActionEnum.Edit);
            }
            if (!hasRights)
            {
                return(Json("You are UnAuthorized to do this action"));
            }

            #endregion
            return(Json(LibraryCommonHelper.AddEditContainerType(containerTypeId, containerTypeName, maxCBM, maxWeight)));
        }
Example #9
0
        public ActionResult AddEditExpense(int expenseId, string expenseNameEn, string expenseNameAr)
        {
            #region Check Rights
            bool hasRights = false;
            if (expenseId == 0)
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.ExpensesLibrary, ActionEnum.Add);
            }
            else
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.ExpensesLibrary, ActionEnum.Edit);
            }
            if (!hasRights)
            {
                return(Json("You are UnAuthorized to do this action"));
            }

            #endregion
            return(Json(LibraryCommonHelper.AddEditExpense(expenseId, expenseNameEn, expenseNameAr)));
        }
Example #10
0
        public ActionResult AddEditIncoterm(int incotermId, string incotermCode, string incotermName)
        {
            #region Check Rights
            bool hasRights = false;
            if (incotermId == 0)
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.IncotermLibrary, ActionEnum.Add);
            }
            else
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.IncotermLibrary, ActionEnum.Edit);
            }
            if (!hasRights)
            {
                return(Json("You are UnAuthorized to do this action"));
            }

            #endregion
            return(Json(LibraryCommonHelper.AddEditIncoterm(incotermId, incotermCode, incotermName)));
        }
Example #11
0
        public ActionResult AddEditVessel(int vesselId, string vesselName)
        {
            #region Check Rights
            bool hasRights = false;
            if (vesselId == 0)
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.VesselsLibrary, ActionEnum.Add);
            }
            else
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.VesselsLibrary, ActionEnum.Edit);
            }
            if (!hasRights)
            {
                return(Json("You are UnAuthorized to do this action"));
            }
            #endregion

            string isSaved = LibraryCommonHelper.AddEditVessel(vesselId, vesselName);
            return(Json(isSaved));
        }
Example #12
0
        public ActionResult AddEditPackageType(int packageTypeId, string packageTypeNameEn, string packageTypeNameAr)
        {
            #region Check Rights
            bool hasRights = false;
            if (packageTypeId == 0)
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.PackagesTypes, ActionEnum.Add);
            }
            else
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.PackagesTypes, ActionEnum.Edit);
            }
            if (!hasRights)
            {
                return(Json("You are UnAuthorized to do this action"));
            }

            #endregion

            return(Json(LibraryCommonHelper.AddEditPackageType(packageTypeId, packageTypeNameEn, packageTypeNameAr)));
        }
        public ActionResult AddEditCountry(int countryId, string countyNameEn, string countryNameAr)
        {
            #region Check Rights
            bool hasRights = false;
            if (countryId == 0)
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.CountriesLibrary, ActionEnum.Add);
            }
            else
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.CountriesLibrary, ActionEnum.Edit);
            }
            if (!hasRights)
            {
                return(Json("You are UnAuthorized to do this action"));
            }

            #endregion

            return(Json(LibraryCommonHelper.AddEditCountry(countryId, countyNameEn, countryNameAr)));
        }
Example #14
0
        public ActionResult VesselLibrary()
        {
            var vesselList = LibraryCommonHelper.GetVesselList();

            return(View(vesselList));
        }
Example #15
0
        public ActionResult Incoterm()
        {
            var incotermList = LibraryCommonHelper.GetIncotermList();

            return(View(incotermList));
        }
Example #16
0
        public ActionResult Index()
        {
            var containersTypeList = LibraryCommonHelper.GetContainersTypeList();

            return(View(containersTypeList));
        }
Example #17
0
        public ActionResult ExpensesLibrary()
        {
            var expensesList = LibraryCommonHelper.GetExpenseLibList();

            return(View(expensesList));
        }
Example #18
0
        public ActionResult PackageType()
        {
            var packageTypeList = LibraryCommonHelper.GetPackageTypesList();

            return(View(packageTypeList));
        }
        public ActionResult Index()
        {
            var countyList = LibraryCommonHelper.GetCountriesList();

            return(View(countyList));
        }