Ejemplo n.º 1
0
        public ActionResult AddEditPort(EasyFreight.Models.Port portDb)
        {
            #region Check Rights
            bool hasRights;
            if (portDb.PortId == 0) //Check export rights
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.PortsLibrary, ActionEnum.Add);
            }
            else
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.PortsLibrary, ActionEnum.Edit);
            }

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

            #endregion

            string isSaved = LibraryCommonHelper.AddEditPort(portDb);
            if (isSaved != "true")
            {
                return(Json(isSaved));
            }
            var portsList = LibraryCommonHelper.GetPortsListByCityId(0);
            return(PartialView("~/Areas/MasterData/Views/CountryLibrary/_PortsTable.cshtml", portsList));
        }