Пример #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
 /// <summary>
 /// Adding and updating country information
 /// </summary>
 /// <param name="countryId"></param>
 /// <param name="countryName"></param>
 /// <param name="countryShortName"></param>
 /// <param name="CreatedBy"></param>
 public void Admin_UpdateCountry(MasterCountryDTO dto)
 {
     try
     {
         SqlHelper.QuerySP("Admin_UpdateCountry",
                           new
         {
             CountryId        = dto.CountryId,
             CountryName      = dto.CountryName,
             CountryShortName = dto.CountryShortName,
             CreatedBy        = dto.CreatedBy,
             IsDefault        = dto.IsDefault,
             ServerName       = dto.ServerName,
             IsWindowsAccess  = dto.IsWindowsAccess,
             UserName         = dto.UserName,
             Password         = dto.Password,
             DatabaseName     = dto.DatabaseName,
             DistanceMeasure  = dto.DistanceMeasure,
             MetersIn         = dto.MetersIn
         });
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #3
0
 public void Admin_UpdateCountry(MasterCountryDTO dto)
 {
     try
     {
         _dataAccessCountry.Admin_UpdateCountry(dto);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #4
0
 public void Admin_UpdateCountry(MasterCountryDTO dto)
 {
     try
     {
         _client.Admin_UpdateCountry(dto);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #5
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));
        }
Пример #6
0
 public MasterCountryDTO Admin_GetCountryOnId(int countryId)
 {
     try
     {
         MasterCountryDTO _returnResult = SqlHelper.QuerySP <MasterCountryDTO>("Admin_GetCountryOnId",
                                                                               new
         {
             CountryId = countryId
         }).ToList().FirstOrDefault();
         return(_returnResult);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #7
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));
        }