/// <summary> /// 同步近效期产品 /// </summary> public void SyncExpritationProduct() { DbBase db = new DbBase(); com.APISoapClient bll = new com.APISoapClient(); string sql = System.Configuration.ConfigurationManager.AppSettings["SQL_Product_ExpirationTime"]; DataSet ds = db.ExecuteDataSet(sql); if (ds != null && ds.Tables[0].Rows.Count > 0) { //调用web服务 bll.AddExpirationTimeProduct(ds, key); } }
/// <summary> /// 同步会员经营范围 /// </summary> public void SyncMemberBusinessScope() { DbBase db = new DbBase(); string sql = System.Configuration.ConfigurationManager.AppSettings["SQL_MemberBusinessScope"]; com.APISoapClient bll = new com.APISoapClient(); DataSet ds = db.ExecuteDataSet(sql); if (ds != null && ds.Tables[0].Rows.Count > 0) { //调用web服务 bll.SyncMemberBusinessScope(ds, key); } }
/// <summary> /// 发送会员信息至商城 /// </summary> public void SendMemberinfo() { DbBase db = new DbBase(); com.APISoapClient bll = new com.APISoapClient(); string SQL_Memberinfo = System.Configuration.ConfigurationManager.AppSettings["SQL_Memberinfo"]; try { bll.SendMember(db.ExecuteDataSet(SQL_Memberinfo), key); } catch (Exception ex) { AddLog(ex.ToString()); } }
/// <summary> /// 发送订单状态变化至商城 /// </summary> public void SendOrderStatus() { com.APISoapClient bll = new com.APISoapClient(); DbBase db = new DbBase(); string sql = System.Configuration.ConfigurationManager.AppSettings["SQL_I_ERP_OrderStatus_NOTE"]; foreach (DataRow item in db.ExecuteTable(sql).Rows) { try { bll.UpdateOrderStatusForErp((string)item["orderid"], (string)item["proid"], (int)item["Status"], key); db.ExecuteNonQuery(string.Format("UPDATE I_ERP_OrderStatus_NOTE SET handleStatus=1,handleTime=GETDATE() WHERE id={0}", item["id"])); } catch (Exception e) { sql = string.Format("UPDATE I_ERP_OrderStatus_NOTE SET handleStatus=2,handleTime=GETDATE(),notes=@notes WHERE id={0}", item["id"]); var dbCommand = db._db.GetSqlStringCommand(sql); db._db.AddInParameter(dbCommand, "notes", DbType.String, e.ToString()); db._db.ExecuteNonQuery(dbCommand); } } }