示例#1
0
        public int Insert(dtoCustomer dtoCustomer)
        {
            dalCustomer dalCustomer = new dalCustomer();
            int         count       = dalCustomer.InsertCustomer(dtoCustomer);

            return(count);
        }
示例#2
0
        public int Update(dtoCustomer dtoCustomer)
        {
            dalCustomer Customer = new dalCustomer();
            int         count    = Customer.UpdateCustomerFromID(dtoCustomer);

            return(count);
        }
示例#3
0
    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)));
    }
示例#4
0
    //模糊查询
    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)));
    }
示例#5
0
    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)));
    }
示例#6
0
        public long GetPrice(int id)
        {
            dalCustomer customer = new dalCustomer();

            if (customer.GetU22Customer(id))
            {
                return(45000);
            }
            else
            {
                return(75000);
            }
        }
示例#7
0
        public long GetTotalMoney(int sl, int id)
        {
            dalCustomer customer = new dalCustomer();

            if (customer.GetU22Customer(id))
            {
                return(45000 * sl);
            }
            else
            {
                return(75000 * sl);
            }
        }
示例#8
0
        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);
        }
示例#9
0
        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);
        }
示例#10
0
        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);
        }