public string Save(BLL.gigade.Model.OrderSlave orderSlave) { orderSlave.Replace4MySQL(); StringBuilder strSql = new StringBuilder("insert into order_slave(`slave_id`,`order_id`,`vendor_id`,`slave_product_subtotal`,`slave_amount`,"); strSql.Append("`slave_status`,`slave_note`,`slave_ipfrom`)values({0},{1},"); strSql.AppendFormat("{0},{1},", orderSlave.Vendor_Id, orderSlave.Slave_Product_Subtotal); strSql.AppendFormat("{0},{1},'{2}','{3}')", orderSlave.Slave_Amount, orderSlave.Slave_Status, orderSlave.Slave_Note, orderSlave.Slave_Ipfrom); return strSql.ToString(); }
public string SaveUserLife(BLL.gigade.Model.UserLife model) { model.Replace4MySQL(); StringBuilder sql = new StringBuilder(); sql.AppendFormat(@"insert into user_life (user_id,info_type, info_code,info_name,remark,kdate,kuser) values('{0}','{1}','{2}','{3}','{4}','{5}','{6}');", model.user_id, model.info_type, model.info_code, model.info_name, model.remark, model.kdate, model.kuser); return sql.ToString(); }
public string SaveNoProductId(BLL.gigade.Model.ProductStatusHistory save) { try { save.Replace4MySQL(); StringBuilder stb = new StringBuilder("set sql_safe_updates = 0; insert into product_status_history (`product_id`,`user_id`,`create_time`,`type`,`product_status`,`remark`) values ({0}"); stb.AppendFormat(",{0},now(),{1},{2},'{3}');set sql_safe_updates = 1;", save.user_id, save.type, save.product_status, save.remark); return stb.ToString(); } catch (Exception ex) { throw new Exception("ProductStatusHistoryDao.SaveNoProductId-->" + ex.Message, ex); } }
public string Save(BLL.gigade.Model.OrderDetail orderDetail) { //edit by castle 2014/07/09 //訂單匯入時,order_detail.event_cost請勿填寫,只需寫single_cost 若為組合也是,父項及子項的event_cost都不應寫入。 orderDetail.Replace4MySQL(); StringBuilder strSql = new StringBuilder("insert into order_detail(`detail_id`,`slave_id`,`item_id`,`item_vendor_id`,`product_freight_set`,`product_mode`,`product_name`,`product_spec_name`,`single_cost`,"); strSql.Append("`single_price`,`single_money`,`deduct_bonus`,`deduct_welfare`,`deduct_happygo`,`deduct_account`,`deduct_account_note`,"); strSql.Append("`buy_num`,`detail_status`,`detail_note`,`item_code`,`channel_detail_id`,`combined_mode`,`item_mode`,`parent_id`,`sub_order_id`,`pack_id`,`parent_name`,`price_master_id`,`bag_check_money`,`parent_num`,`prepaid`,`site_id`,`event_cost`,`accumulated_bonus`)values({0},{1},");// edit by zhuoqin0830w 添加 活動成本參數 2015/03/24 Ahon林志鴻 說需要更改 strSql.AppendFormat("{0},{1},{2},{3},", orderDetail.Item_Id, orderDetail.Item_Vendor_Id, orderDetail.Product_Freight_Set, orderDetail.Product_Mode); strSql.AppendFormat("'{0}','{1}','{2}',", orderDetail.Product_Name, orderDetail.Product_Spec_Name, orderDetail.Single_Cost); strSql.AppendFormat("{0},{1},{2},{3},{4},", orderDetail.Single_Price, orderDetail.Single_Money, orderDetail.Deduct_Bonus, orderDetail.Deduct_Welfare, orderDetail.Deduct_Happygo); strSql.AppendFormat("{0},'{1}',{2},{3},", orderDetail.Deduct_Account, orderDetail.Deduct_Account_Note, orderDetail.Buy_Num, orderDetail.Detail_Status); strSql.AppendFormat("'{0}','{1}','{2}',{3},{4},", orderDetail.Detail_Note, orderDetail.Item_Code, orderDetail.Channel_Detail_Id, orderDetail.Combined_Mode, orderDetail.item_mode); strSql.AppendFormat("{0},'{1}',{2},'{3}',{4},{5},", orderDetail.Parent_Id, orderDetail.Sub_Order_Id, orderDetail.pack_id, orderDetail.parent_name, orderDetail.price_master_id, orderDetail.Bag_Check_Money); strSql.AppendFormat("{0},{1},{2},{3},{4})", orderDetail.parent_num, orderDetail.Prepaid, orderDetail.Site_Id, orderDetail.Event_Cost, orderDetail.Accumulated_Bonus); // edit by zhuoqin0830w 添加 活動成本參數 2015/03/24 Ahon林志鴻 說需要更改 return strSql.ToString(); }
public int UpdateColumn(BLL.gigade.Model.ProductStatusHistory save) { StringBuilder sb = new StringBuilder(); try { save.Replace4MySQL(); sb.AppendFormat(@"SET SQL_SAFE_UPDATES = 0;UPDATE `product_status_history` SET `remark` = '{0}' WHERE product_id = {1};SET SQL_SAFE_UPDATES = 1;",save.remark,save.product_id); return _access.execCommand(sb.ToString()); } catch (Exception ex) { throw new Exception("ProductStatusHistoryDao-->UpdateColumn" + ex.Message,ex); } }
/// <summary> /// 插入訂單主表sql /// </summary> /// <param name="orderMaster"></param> /// <returns></returns> public string Save(BLL.gigade.Model.OrderMaster orderMaster) { StringBuilder strSql = new StringBuilder(); try { orderMaster.Replace4MySQL(); strSql.Append("insert into order_master(`order_id`,`user_id`,`order_gender`,`delivery_gender`,`bonus_receive`,`deduct_happygo_convert`,`deduct_bonus`,`deduct_welfare`,"); strSql.Append("`deduct_account`,`order_freight_normal`,`order_freight_low`,`order_product_subtotal`,`order_amount`,"); strSql.Append("`order_status`,`order_payment`,`order_name`,`order_mobile`,`order_phone`,`order_address`,`delivery_name`,`delivery_mobile`,"); strSql.Append("`delivery_phone`,`delivery_zip`,`delivery_address`,`estimated_arrival_period`,`company_invoice`,`company_title`,"); strSql.Append("`invoice_id`,`order_invoice`,`invoice_status`,`note_order`,`note_admin`,`order_date_pay`,`order_createdate`,`order_updatedate`,"); strSql.Append("`order_ipfrom`,`source_trace`,`source_cookie_value`,`source_cookie_name`,`note_order_modifier`,`note_order_modify_time`,`error_check`,`channel`,"); strSql.Append("`channel_order_id`,`delivery_store`,`billing_checked`,`order_zip`,`retrieve_mode`,`holiday_deliver`,`import_time`,`export_flag`,`cart_id`,`accumulated_bonus`)values({0},"); strSql.AppendFormat("{0},{1},{2},{3},", orderMaster.User_Id, orderMaster.Order_Gender, orderMaster.Delivery_Gender, orderMaster.Bonus_Receive);//add by wwei0216w 添加訂購人和收件人性別orderMaster.Order_Gender,orderMaster.Delivery_Gender 2015/1/21 strSql.AppendFormat("{0},{1},{2},{3},", orderMaster.Deduct_Happygo_Convert, orderMaster.Deduct_Bonus, orderMaster.Deduct_Welfare, orderMaster.Deduct_Account); strSql.AppendFormat("{0},{1},{2},{3},{4},", orderMaster.Order_Freight_Normal, orderMaster.Order_Freight_Low, orderMaster.Order_Product_Subtotal, orderMaster.Order_Amount, orderMaster.Order_Status); strSql.AppendFormat("{0},'{1}','{2}','{3}','{4}',", orderMaster.Order_Payment, orderMaster.Order_Name, orderMaster.Order_Mobile, orderMaster.Order_Phone, orderMaster.Order_Address); strSql.AppendFormat("'{0}','{1}','{2}',{3},'{4}',", orderMaster.Delivery_Name, orderMaster.Delivery_Mobile, orderMaster.Delivery_Phone, orderMaster.Delivery_Zip, orderMaster.Delivery_Address); strSql.AppendFormat("{0},'{1}','{2}',{3},'{4}',", orderMaster.Estimated_Arrival_Period, orderMaster.Company_Invoice, orderMaster.Company_Title, orderMaster.Invoice_Id, orderMaster.Order_Invoice); strSql.AppendFormat("{0},'{1}','{2}',{3},{4},", orderMaster.Invoice_Status, orderMaster.Note_Order, orderMaster.Note_Admin, orderMaster.Order_Date_Pay, orderMaster.Order_Createdate); strSql.AppendFormat("'{0}','{1}','{2}','{3}','{4}',", orderMaster.Order_Updatedate, orderMaster.Order_Ipfrom, orderMaster.Source_Trace, orderMaster.Source_Cookie_Value, orderMaster.Source_Cookie_Name); strSql.AppendFormat("{0},'{1}',{2},'{3}','{4}',", orderMaster.Note_Order_Modifier, orderMaster.Note_Order_Modify_Time, orderMaster.Error_Check, orderMaster.Channel, orderMaster.Channel_Order_Id); strSql.AppendFormat("{0},{1},{2},{3},{4},", orderMaster.Delivery_Store, orderMaster.Billing_Checked, orderMaster.Order_Zip, orderMaster.Retrieve_Mode, orderMaster.Holiday_Deliver); strSql.AppendFormat(orderMaster.Import_Time == DateTime.MinValue ? "null)" : "'" + orderMaster.Import_Time.ToString("yyyy/MM/dd HH:mm:ss") + "',{0},{1},{2})", orderMaster.Export_Flag, orderMaster.Cart_Id, orderMaster.Accumulated_Bonus);//edit by zhuoqin0830w 2015/09/01 添加 accumulated_bonus 欄位 return strSql.ToString(); } catch (Exception ex) { throw new Exception("OrderMasterDao.Save -->" + ex.Message + strSql.ToString(), ex); } }