public GCommon <Service> populateService() { GCommon <Service> colService = new GCommon <Service>(); Service objService = null; string strSql = "select * from tblServiceMaster "; commonclass objcommon = new commonclass(); DataTable dtService = new DataTable(); dtService = objcommon.Fetchrecords(strSql); foreach (DataRow drService in dtService.Rows) { objService = new Service(); objService.service_id = Convert.ToInt32(drService["service_id"]); objService.service_name = Convert.ToString(drService["service_name"]); colService.Add(objService); } return(colService); }
public GCommon <State> populateState() { GCommon <State> colState = new GCommon <State>(); State objstate = null; string strSql = "select * from tblstate order by sname "; commonclass objcommon = new commonclass(); DataTable dtState = new DataTable(); dtState = objcommon.Fetchrecords(strSql); foreach (DataRow drState in dtState.Rows) { objstate = new State(); objstate.sid = Convert.ToInt32(drState["sid"]); objstate.sname = Convert.ToString(drState["sname"]); colState.Add(objstate); } return(colState); }
public GCommon <City> populateCity() { GCommon <City> colCity = new GCommon <City>(); City objCity = null; //string strSql = "select c.city_name " + // " from tblCityMaster c" + // " inner join tblService_SubService_City_Relation r on c.city_id=r.city_id" + // " where c.city_status=1" + // " order by c.city_name"; string strSql = "select * from tblCityMaster order by city_name "; commonclass objcommon = new commonclass(); DataTable dtCity = new DataTable(); dtCity = objcommon.Fetchrecords(strSql); foreach (DataRow drCity in dtCity.Rows) { objCity = new City(); objCity.city_id = Convert.ToInt32(drCity["city_id"]); objCity.city_name = Convert.ToString(drCity["city_name"]); colCity.Add(objCity); } return(colCity); }