Esempio n. 1
0
        public static List <TransactionDetail> GetListByServerResponse(string response)
        {
            if (response == "")
            {
                return(null);
            }
            List <TransactionDetail> members = new List <TransactionDetail>();

            string[] lines = response.Split(new string[] { "<BR>" }, StringSplitOptions.None);
            foreach (string line in lines)
            {
                if (line.Trim() == "")
                {
                    continue;
                }
                string[]          datas = line.Split(';');
                TransactionDetail m     = new TransactionDetail();
                m.trdetail_id    = Convert.ToInt32(datas[0].Trim());
                m.transaction_id = Convert.ToInt32(datas[1].Trim());
                m.menu_id        = Convert.ToInt32(datas[2].Trim());
                m.menu_name      = datas[3];
                m.tr_unit        = Convert.ToInt32(datas[4].Trim());
                m.tr_unit_price  = Convert.ToDecimal(datas[5].Trim());
                m.tr_total_price = Convert.ToDecimal(datas[6].Trim());
                members.Add(m);
            }
            return(members);
        }
Esempio n. 2
0
    public static string GetInsertSQL(TransactionDetail tr)
    {
        return(@"INSERT INTO transactiondetail    
       (transaction_id
       ,menu_id
       ,menu_name
       ,tr_unit
       ,tr_unit_price
       ,tr_total_price       
        )
 VALUES
       ('" + tr.transaction_id + @"'
       ,'" + tr.menu_id + @"'
       ,'" + tr.menu_name + @"'
       ,'" + tr.tr_unit + @"'
       ,'" + tr.tr_unit_price + @"'
       ,'" + tr.Tr_total_price + @"')");
    }