private void UpdateState(string cGuid) { var cmd = new SqlCommand("update wms_m_eas set bEnable=1,cState='已导入',dUpdate=Getdate() where cGuid=@cGuid"); cmd.Parameters.AddWithValue("@cGuid", cGuid); var sfun = new SyncFunction(_wmsCon); sfun.ExecSqlCmd(cmd); }
private void SyncInventory() { var easOrder = new EasOrderService.EasOrder() { Url = _OrderService }; var dtPro = easOrder.GetPro(); var sfun = new SyncFunction(_wmsCon); pbMain.Maximum = dtPro.Rows.Count - 1; pbMain.Value = 0; for (var i = 0; i < dtPro.Rows.Count; i++) { var synCmd = new SqlCommand("SyncInventory") { CommandType = CommandType.StoredProcedure }; synCmd.Parameters.AddWithValue("@cInvCode", dtPro.Rows[i]["cInvCode"]); synCmd.Parameters.AddWithValue("@cInvName", dtPro.Rows[i]["cInvName"]); synCmd.Parameters.AddWithValue("@cInvType", "Pro"); synCmd.Parameters.AddWithValue("@FStatus", dtPro.Rows[i]["FStatus"]); synCmd.Parameters.AddWithValue("@bLotMgr", dtPro.Rows[i]["FIsLotNumber"]); sfun.ExecSqlCmd(synCmd); pbMain.Value = i; } var dtSemi = easOrder.GetSemi(); pbMain.Maximum = dtSemi.Rows.Count - 1; pbMain.Value = 0; for (var i = 0; i < dtSemi.Rows.Count; i++) { var synCmd = new SqlCommand("SyncInventory") { CommandType = CommandType.StoredProcedure }; synCmd.Parameters.AddWithValue("@cInvCode", dtPro.Rows[i]["cInvCode"]); synCmd.Parameters.AddWithValue("@cInvName", dtPro.Rows[i]["cInvName"]); synCmd.Parameters.AddWithValue("@cInvType", "Semi"); synCmd.Parameters.AddWithValue("@FStatus", dtPro.Rows[i]["FStatus"]); synCmd.Parameters.AddWithValue("@bLotMgr", dtPro.Rows[i]["FIsLotNumber"]); sfun.ExecSqlCmd(synCmd); pbMain.Value = i; } var dtRm = easOrder.GetRm(); pbMain.Maximum = dtRm.Rows.Count - 1; pbMain.Value = 0; for (var i = 0; i < dtRm.Rows.Count; i++) { var synCmd = new SqlCommand("SyncInventory") { CommandType = CommandType.StoredProcedure }; synCmd.Parameters.AddWithValue("@cInvCode", dtPro.Rows[i]["cInvCode"]); synCmd.Parameters.AddWithValue("@cInvName", dtPro.Rows[i]["cInvName"]); synCmd.Parameters.AddWithValue("@cInvType", "Rm"); synCmd.Parameters.AddWithValue("@FStatus", dtPro.Rows[i]["FStatus"]); synCmd.Parameters.AddWithValue("@bLotMgr", dtPro.Rows[i]["FIsLotNumber"]); sfun.ExecSqlCmd(synCmd); pbMain.Value = i; } }