public List <Budget_CustomerCare> SelectAll() { List <Budget_CustomerCare> CustomerCareList = null; try { string sSQL = "SELECT * FROM CustomerCare"; DataSet ds = SqlHelper.ExecuteDataset(ConnectionString, CommandType.Text, sSQL); if (ds.Tables[0].Rows.Count > 0) { CustomerCareList = new List <Budget_CustomerCare>(); Budget_CustomerCare customerCare = null; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { customerCare = new Budget_CustomerCare(); customerCare.CustomerCareOID = new Guid(ds.Tables[0].Rows[i]["CustomerCareOID"].ToString()); customerCare.Enable = Convert.ToBoolean(ds.Tables[0].Rows[i]["Enable"].ToString()); customerCare.Seq = Convert.ToInt32(ds.Tables[0].Rows[i]["Seq"].ToString()); customerCare.FileName = ds.Tables[0].Rows[i]["FileName"].ToString(); customerCare.BannerFileName = ds.Tables[0].Rows[i]["BannerFileName"].ToString(); customerCare.Title = ds.Tables[0].Rows[i]["Title"].ToString(); customerCare.ShortDes = ds.Tables[0].Rows[i]["ShortDes"].ToString(); customerCare.Descriptions = ds.Tables[0].Rows[i]["Descriptions"].ToString(); customerCare.imageFileName1 = ds.Tables[0].Rows[i]["imageFileName1"].ToString(); customerCare.imageFileName2 = ds.Tables[0].Rows[i]["imageFileName2"].ToString(); customerCare.imageFileName3 = ds.Tables[0].Rows[i]["imageFileName3"].ToString(); customerCare.imageFileName4 = ds.Tables[0].Rows[i]["imageFileName4"].ToString(); customerCare.imageFileName5 = ds.Tables[0].Rows[i]["imageFileName5"].ToString(); customerCare.imageFileName6 = ds.Tables[0].Rows[i]["imageFileName6"].ToString(); customerCare.imageFileName7 = ds.Tables[0].Rows[i]["imageFileName7"].ToString(); customerCare.imageFileName8 = ds.Tables[0].Rows[i]["imageFileName8"].ToString(); customerCare.imageFileName9 = ds.Tables[0].Rows[i]["imageFileName9"].ToString(); customerCare.imageFileName10 = ds.Tables[0].Rows[i]["imageFileName10"].ToString(); customerCare.imageFileName11 = ds.Tables[0].Rows[i]["imageFileName11"].ToString(); customerCare.imageFileName12 = ds.Tables[0].Rows[i]["imageFileName12"].ToString(); customerCare.imageFileName13 = ds.Tables[0].Rows[i]["imageFileName13"].ToString(); customerCare.imageFileName14 = ds.Tables[0].Rows[i]["imageFileName14"].ToString(); customerCare.imageFileName15 = ds.Tables[0].Rows[i]["imageFileName15"].ToString(); CustomerCareList.Add(customerCare); } } } catch (Exception ex) { } return(CustomerCareList); }
public Budget_CustomerCare SelectByOID(Guid guidCustomerCareOID) { Budget_CustomerCare customerCare = null; try { string sSQL = "SELECT * FROM CustomerCare WHERE CustomerCareOID=@CustomerCareOID"; SqlParameter[] sqlParam = new SqlParameter[1]; sqlParam[0] = new SqlParameter("@CustomerCareOID", SqlDbType.UniqueIdentifier); sqlParam[0].Value = guidCustomerCareOID; DataSet ds = SqlHelper.ExecuteDataset(ConnectionString, CommandType.Text, sSQL, sqlParam); if (ds.Tables[0].Rows.Count > 0) { customerCare = new Budget_CustomerCare(); customerCare.CustomerCareOID = new Guid(ds.Tables[0].Rows[0]["CustomerCareOID"].ToString()); customerCare.Enable = Convert.ToBoolean(ds.Tables[0].Rows[0]["Enable"].ToString()); customerCare.Seq = Convert.ToInt32(ds.Tables[0].Rows[0]["Seq"].ToString()); customerCare.FileName = ds.Tables[0].Rows[0]["FileName"].ToString(); customerCare.BannerFileName = ds.Tables[0].Rows[0]["BannerFileName"].ToString(); customerCare.Title = ds.Tables[0].Rows[0]["Title"].ToString(); customerCare.ShortDes = ds.Tables[0].Rows[0]["ShortDes"].ToString(); customerCare.Descriptions = ds.Tables[0].Rows[0]["Descriptions"].ToString(); customerCare.imageFileName1 = ds.Tables[0].Rows[0]["imageFileName1"].ToString(); customerCare.imageFileName2 = ds.Tables[0].Rows[0]["imageFileName2"].ToString(); customerCare.imageFileName3 = ds.Tables[0].Rows[0]["imageFileName3"].ToString(); customerCare.imageFileName4 = ds.Tables[0].Rows[0]["imageFileName4"].ToString(); customerCare.imageFileName5 = ds.Tables[0].Rows[0]["imageFileName5"].ToString(); customerCare.imageFileName6 = ds.Tables[0].Rows[0]["imageFileName6"].ToString(); customerCare.imageFileName7 = ds.Tables[0].Rows[0]["imageFileName7"].ToString(); customerCare.imageFileName8 = ds.Tables[0].Rows[0]["imageFileName8"].ToString(); customerCare.imageFileName9 = ds.Tables[0].Rows[0]["imageFileName9"].ToString(); customerCare.imageFileName10 = ds.Tables[0].Rows[0]["imageFileName10"].ToString(); customerCare.imageFileName11 = ds.Tables[0].Rows[0]["imageFileName11"].ToString(); customerCare.imageFileName12 = ds.Tables[0].Rows[0]["imageFileName12"].ToString(); customerCare.imageFileName13 = ds.Tables[0].Rows[0]["imageFileName13"].ToString(); customerCare.imageFileName14 = ds.Tables[0].Rows[0]["imageFileName14"].ToString(); customerCare.imageFileName15 = ds.Tables[0].Rows[0]["imageFileName15"].ToString(); } } catch (Exception ex) { } return(customerCare); }