예제 #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));
        }