public void UpdateCountry(PROPCountry country) { SQLHelper sqlHelper = new SQLHelper(); List <SqlParameter> lstParameter = new List <SqlParameter>(); lstParameter.Add(new SqlParameter("_CountryID", country.CountryID)); lstParameter.Add(new SqlParameter("_CountryName", country.CountryName)); sqlHelper.executenonquery(lstParameter, "UpdateCountryName"); }
public bool updateCountry(PROPCountry country) { if (string.IsNullOrEmpty(country.CountryName) || country.CountryID <= 0) { return(false); } else { DALCountry dalCountry = new DALCountry(); dalCountry.UpdateCountry(country); return(true); } }
public List <PROPCountry> getAllCountry() { List <PROPCountry> countryList = new List <PROPCountry>(); SQLHelper sqlHelper = new SQLHelper(); List <SqlParameter> parameters = new List <SqlParameter>(); var resultSet = sqlHelper.executeSP <DataSet>(parameters, "getAllCountry"); PROPCountry country; foreach (DataRow drow in resultSet.Tables[0].Rows) { country = new PROPCountry(Convert.ToInt32(drow[0].ToString()), drow[1].ToString()); countryList.Add(country); } return(countryList); }
public List <PROPCountry> getCountry(string searchCountry) { List <PROPCountry> countryList = new List <PROPCountry>(); SQLHelper sqlHelper = new SQLHelper(); List <MySqlParameter> parameters = new List <MySqlParameter>(); parameters.Add(new MySqlParameter("_CountryName", searchCountry)); var resultSet = sqlHelper.executeSP <DataSet>(parameters, "SelectCountryByName"); PROPCountry country; foreach (DataRow drow in resultSet.Tables[0].Rows) { country = new PROPCountry(Convert.ToInt32(drow[0].ToString()), drow[1].ToString()); countryList.Add(country); } return(countryList); }