public CustomerInfo MapCustomerByID(IDataReader record) { CustomerInfo customer = new CustomerInfo(); if (record.Read()) { if (record["CustomerId"] != DBNull.Value) customer.CustomerId = record["CustomerId"].ToString(); if (record["CustomerName"] != DBNull.Value) customer.CustomerName = record["CustomerName"].ToString(); if (record["Role"] != DBNull.Value) customer.Role = record["Role"].ToString(); if (record["LastOnline"] != DBNull.Value) customer.LastOnline = (DateTime)record["LastOnline"]; return customer; } return null; }
public List<CustomerInfo> mapCustomerByName(IDataReader record) { List<CustomerInfo> cusList = new List<CustomerInfo>(); while (record.Read()) { CustomerInfo customer = new CustomerInfo(); if (record["CustomerId"] != DBNull.Value) customer.CustomerId = record["CustomerId"].ToString(); if (record["CustomerName"] != DBNull.Value) customer.CustomerName = record["CustomerName"].ToString(); if (record["Role"] != DBNull.Value) customer.Role = record["Role"].ToString(); if (record["LastOnline"] != DBNull.Value) customer.LastOnline = (DateTime)record["LastOnline"]; cusList.Add(customer); } return cusList; }
public bool UpdateCustomerInfo(CustomerInfo cus) { string query = "CHAT.CUSTOMER_UPDATE"; try { OracleDataHelper helper = OracleHelper; helper.BeginTransaction(); helper.ExecuteNonQuery(query, cus.CustomerId, cus.CustomerName); helper.Commit(); } catch (Exception ex) { OracleHelper.Rollback(); throw ex; } return true; }
public static bool InsertCustomerInfo(CustomerInfo cus) { return ObjectController.DataProvider.InsertCustomerInfo(cus); }