//private DateTime getMaxDateTime(DateTime dt,List<Item>lItems) //{ // foreach(Item i in lItems) // { // try // { // DateTime curDateTime = DateTime.Parse(i.tid_time); // if (curDateTime > dt) // { // dt = curDateTime; // } // } // catch // { // } // } // return dt; //} public List <tid_item> GetItemEntry(JArray j) { List <tid_item> ltid_item = new List <tid_item>(); foreach (JObject jo in j) { tid_item t = new tid_item(); t.storage_id = jo["storage_id"].ToString(); t.tid = jo["tid"].ToString(); t.pro_detail_code = jo["pro_detail_code"].ToString(); t.pro_name = jo["pro_name"].ToString(); t.specification = jo["specification"].ToString(); t.barcode = jo["barcode"].ToString(); t.combine_barcode = jo["combine_barcode"].ToString(); t.iscancel = jo["iscancel"].ToString(); t.isscheduled = jo["isscheduled"].ToString(); t.stock_situation = jo["stock_situation"].ToString(); t.isbook_pro = jo["isbook_pro"].ToString(); t.iscombination = jo["iscombination"].ToString(); t.isgifts = jo["isgifts"].ToString(); t.gift_num = jo["gift_num"].ToString(); t.book_storage = jo["book_storage"].ToString(); t.pro_num = jo["pro_num"].ToString(); t.send_num = jo["send_num"].ToString(); t.refund_num = jo["refund_num"].ToString(); t.refund_renum = jo["refund_renum"].ToString(); t.inspection_num = jo["inspection_num"].ToString(); t.timeinventory = jo["timeinventory"].ToString(); t.cost_price = jo["cost_price"].ToString(); t.sell_price = jo["sell_price"].ToString(); t.average_price = jo["average_price"].ToString(); t.original_price = jo["original_price"].ToString(); t.sys_price = jo["sys_price"].ToString(); t.ferght = jo["ferght"].ToString(); t.item_discountfee = jo["item_discountfee"].ToString(); t.inspection_time = jo["inspection_time"].ToString(); t.weight = jo["weight"].ToString(); t.shopid = jo["shopid"].ToString(); t.out_tid = jo["out_tid"].ToString(); t.out_proid = jo["out_proid"].ToString(); t.out_prosku = jo["out_prosku"].ToString(); t.proexplain = jo["proexplain"].ToString(); t.buyer_memo = jo["buyer_memo"].ToString(); t.seller_remark = jo["seller_remark"].ToString(); t.distributer = jo["distributer"].ToString(); t.distribut_time = jo["distribut_time"].ToString(); t.second_barcode = jo["second_barcode"].ToString(); t.product_no = jo["product_no"].ToString(); t.brand_number = jo["brand_number"].ToString(); t.brand_name = jo["brand_name"].ToString(); t.book_inventory = jo["book_inventory"].ToString(); t.product_specification = jo["product_specification"].ToString(); t.discount_amount = jo["discount_amount"].ToString(); t.credit_amount = jo["credit_amount"].ToString(); t.MD5_encryption = jo["MD5_encryption"].ToString(); t.sncode = jo["sncode"].ToString(); t.store_location = jo["store_location"].ToString(); t.pro_type = jo["pro_type"].ToString(); ltid_item.Add(t); } return(ltid_item); }
private void CreateItemEntry(string tid, List <tid_item> items) { SqlParameter[] pars = new SqlParameter[] { new SqlParameter("@tid", tid) }; using (SqlDataReader r = SqlHelper.ExecuteReader(strcon, CommandType.Text, "select * from tb_TradeEntry where tid = @tid union all select * from tb_TradeEntry_old where tid = @tid", pars)) { while (r.Read()) { tid_item t = new tid_item(); t.storage_id = r["storage_id"].ToString(); t.tid = r["tid"].ToString(); t.pro_detail_code = r["pro_detail_code"].ToString(); t.pro_name = r["pro_name"].ToString(); t.specification = r["specification"].ToString(); t.barcode = r["barcode"].ToString(); t.combine_barcode = r["combine_barcode"].ToString(); t.iscancel = r["iscancel"].ToString(); t.isscheduled = r["isscheduled"].ToString(); t.stock_situation = r["stock_situation"].ToString(); t.isbook_pro = r["isbook_pro"].ToString(); t.iscombination = r["iscombination"].ToString(); t.isgifts = r["isgifts"].ToString(); t.gift_num = r["gift_num"].ToString(); t.book_storage = r["book_storage"].ToString(); t.pro_num = r["pro_num"].ToString(); t.send_num = r["send_num"].ToString(); t.refund_num = r["refund_num"].ToString(); t.refund_renum = r["refund_renum"].ToString(); t.inspection_num = r["inspection_num"].ToString(); t.timeinventory = r["timeinventory"].ToString(); t.cost_price = r["cost_price"].ToString(); t.sell_price = r["sell_price"].ToString(); t.average_price = r["average_price"].ToString(); t.original_price = r["original_price"].ToString(); t.sys_price = r["sys_price"].ToString(); t.ferght = r["ferght"].ToString(); t.item_discountfee = r["item_discountfee"].ToString(); t.inspection_time = r["inspection_time"].ToString(); t.weight = r["weight"].ToString(); t.shopid = r["shopid"].ToString(); t.out_tid = r["out_tid"].ToString(); t.out_proid = r["out_proid"].ToString(); t.out_prosku = r["out_prosku"].ToString(); t.proexplain = r["proexplain"].ToString(); t.buyer_memo = r["buyer_memo"].ToString(); t.seller_remark = r["seller_remark"].ToString(); t.distributer = r["distributer"].ToString(); t.distribut_time = r["distribut_time"].ToString(); t.second_barcode = r["second_barcode"].ToString(); t.product_no = r["product_no"].ToString(); t.brand_number = r["brand_number"].ToString(); t.brand_name = r["brand_name"].ToString(); t.book_inventory = r["book_inventory"].ToString(); t.product_specification = r["product_specification"].ToString(); t.discount_amount = r["discount_amount"].ToString(); t.credit_amount = r["credit_amount"].ToString(); t.MD5_encryption = r["MD5_encryption"].ToString(); t.sncode = r["sncode"].ToString(); t.store_location = r["store_location"].ToString(); t.pro_type = r["pro_type"].ToString(); items.Add(t); } } }