public int Insert(dtoCustomer dtoCustomer) { dalCustomer dalCustomer = new dalCustomer(); int count = dalCustomer.InsertCustomer(dtoCustomer); return(count); }
public int Update(dtoCustomer dtoCustomer) { dalCustomer Customer = new dalCustomer(); int count = Customer.UpdateCustomerFromID(dtoCustomer); return(count); }
public byte[] GetCustomerByAttributeCodes(byte[] loginTicket, string attributeCodes, bool nameWithCode) { Loginer loginer = WebServiceSecurity.ValidateLoginer(loginTicket); DataTable data = new dalCustomer(loginer).GetCustomerByAttributeCodes(attributeCodes, nameWithCode); return(ZipTools.CompressionObject(ServerLibrary.TableToDataSet(data))); }
//模糊查询 public byte[] FuzzySearchCustomerByAttributes(byte[] loginTicket, string attributeCodes, string content) { Loginer loginer = WebServiceSecurity.ValidateLoginer(loginTicket); DataTable data = new dalCustomer(loginer).FuzzySearch(attributeCodes, content); return(ZipTools.CompressionObject(ServerLibrary.TableToDataSet(data))); }
public byte[] FuzzySearchCustomer(byte[] loginTicket, string customerFrom, string customerTo, string customerName, string customerAttribute) { Loginer loginer = WebServiceSecurity.ValidateLoginer(loginTicket); DataTable data = new dalCustomer(loginer).SearchBy(customerFrom, customerTo, customerName, customerAttribute); return(ZipTools.CompressionObject(ServerLibrary.TableToDataSet(data))); }
public long GetPrice(int id) { dalCustomer customer = new dalCustomer(); if (customer.GetU22Customer(id)) { return(45000); } else { return(75000); } }
public long GetTotalMoney(int sl, int id) { dalCustomer customer = new dalCustomer(); if (customer.GetU22Customer(id)) { return(45000 * sl); } else { return(75000 * sl); } }
public string GetCustomerName(int id) { dalCustomer dal = new dalCustomer(); DataTable data = dal.GetCustomers(); for (int i = 0; i < data.Rows.Count; i++) { DataRow row = data.Rows[i]; if (Convert.ToInt32(row[0]) == id) { return(row[1].ToString()); } } return(null); }
public DateTime GetCustomerBirthDay(int id) { DateTime customerBD = new DateTime(); dalCustomer dal = new dalCustomer(); DataTable data = dal.GetCustomers(); for (int i = 0; i < data.Rows.Count; i++) { DataRow row = data.Rows[i]; if (Convert.ToInt32(row[0]) == id) { customerBD = Convert.ToDateTime(row[5]); } } return(customerBD); }
public List <dtoCustomer> GetCustomers() { dalCustomer dalCustomer = new dalCustomer(); List <dtoCustomer> listEmp = new List <dtoCustomer>(); DataTable Customers = dalCustomer.GetCustomers(); for (int i = 0; i < Customers.Rows.Count; i++) { dtoCustomer Customer = new dtoCustomer(); DataRow row = Customers.Rows[i]; Customer.CustomerID = Convert.ToInt32(row[0]); Customer.FullName = row[1].ToString(); Customer.Gender = row[2].ToString(); Customer.PhoneNumber = row[3].ToString(); Customer.Email = row[4].ToString(); Customer.BirthDay = Convert.ToDateTime(row[5]); Customer.Address = row[6].ToString(); listEmp.Add(Customer); } return(listEmp); }