示例#1
0
        public ActionResult AddCountry(ModelCountry model)
        {
            if (_ICountry.Admin_CheckCountryExist(model.CountryName, model.CountryId).Count > 0)
            {
                model.ErrorMessage = "Country name already existed";
            }
            else
            {
                MasterCountryDTO dto = new MasterCountryDTO();
                dto.CountryId        = model.CountryId;
                dto.DatabaseName     = model.DatabaseName;
                dto.DistanceMeasure  = model.DistanceMeasure;
                dto.IsDefault        = model.IsDefault;
                dto.IsWindowsAccess  = model.IsWindowsAccess;
                dto.MetersIn         = model.MetersIn;
                dto.Password         = model.Password;
                dto.ServerName       = model.ServerName;
                dto.UserName         = model.UserName;
                dto.CountryName      = model.CountryName;
                dto.CountryShortName = model.CountryShortName;
                dto.CreatedBy        = userEntity.UserName;

                _ICountry.Admin_UpdateCountry(dto);
                Response.Redirect("ManageCountry");
            }
            return(View(model));
        }
示例#2
0
 public ActionResult AddCountry(ModelCountry model)
 {
     if (_ICountry.Admin_CheckCountryExist(model.CountryName, model.CountryId).Count > 0)
     {
         model.ErrorMessage = "Country name already existed";
     }
     else
     {
         _ICountry.Admin_UpdateCountry(model.CountryId, model.CountryName, model.CountryShortName, CurrentUser.UserName, model.IsDefault);
         Response.Redirect("/Country/ManageCountry");
     }
     return(View(model));
 }
示例#3
0
        public ActionResult AddCountry(int countryId)
        {
            ModelCountry model = new ModelCountry();

            if (countryId > 0)
            {
                MasterCountryDTO _adminUser = _ICountry.Admin_GetCountryOnId(countryId);
                model.CountryId        = _adminUser.CountryId;
                model.CountryName      = _adminUser.CountryName;
                model.CountryShortName = _adminUser.CountryShortName;
            }


            return(View(model));
        }
示例#4
0
        public ActionResult AddCountry(int countryId)
        {
            ModelCountry model = new ModelCountry();

            if (countryId > 0)
            {
                MasterCountryDTO adminUser = _ICountry.Admin_GetCountry().FirstOrDefault(x => x.CountryId == countryId);
                model.CountryId        = adminUser.CountryId;
                model.CountryName      = adminUser.CountryName;
                model.CountryShortName = adminUser.CountryShortName;
                model.DatabaseName     = adminUser.DatabaseName;
                model.DistanceMeasure  = adminUser.DistanceMeasure;
                model.IsDefault        = adminUser.IsDefault;
                model.IsWindowsAccess  = adminUser.IsWindowsAccess;
                model.MetersIn         = adminUser.MetersIn;
                model.Password         = adminUser.Password;
                model.ServerName       = adminUser.ServerName;
                model.UserName         = adminUser.UserName;
            }


            return(View(model));
        }