Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
 public static bool InsertCustomerInfo(CustomerInfo cus)
 {
     return ObjectController.DataProvider.InsertCustomerInfo(cus);
 }