public List<Customer> getCustomerV() { sqlprm.Clear(); DataTable dtCus = this.sqlOp.executeSPInstantly("OSYS..sp_GetCustomerV", sqlprm); Customer cus; List<Customer> cusList = new List<Customer>(); foreach (DataRow row in dtCus.Rows) { cus = new Customer(); cus.ID = Convert.ToInt64(row["ID"]); cus.GroupID = Convert.ToInt32(row["GroupID"]); cus.Name = row["Name"] == null ? null : row["Name"].ToString(); cus.GroupName = row["GroupName"] == null ? null : row["GroupName"].ToString(); cus.CustomerNo = row["CustomerNo"] == null ? null : row["CustomerNo"].ToString(); cus.Address = row["Address"] == null ? null : row["Address"].ToString(); cus.EMail = row["EMail"] == null ? null : row["EMail"].ToString(); cus.Phone = row["Phone"] == null ? null : row["Phone"].ToString(); cus.TaxOfficeName = row["TaxOfficeName"] == null ? null : row["TaxOfficeName"].ToString(); cus.TaxOfficeNumber = row["TaxOfficeNumber"] == null ? null : row["TaxOfficeNumber"].ToString(); cusList.Add(cus); } dtCus.Clear(); return cusList; }
public List<Customer> getCustomerByGroupID(long groupID) { sqlprm.Clear(); sqlprm = new Dictionary<string, object>(); sqlprm.Add("groupID", groupID); DataTable dtCus = this.sqlOp.executeSPInstantly("OSYS..sp_GetCustomerByGroupID", sqlprm); Customer cus; List<Customer> cusList = new List<Customer>(); foreach (DataRow row in dtCus.Rows) { cus = new Customer(); cus.Name = row["Name"] == null ? null : row["Name"].ToString(); cus.EMail = row["EMail"] == null ? null : row["EMail"].ToString(); cus.Phone = row["Phone"] == null ? null : row["Phone"].ToString(); cusList.Add(cus); } dtCus.Clear(); return cusList; }