public void InsertHandSupplyOrders(DataTable newSupplyOrders) { foreach (DataRow dataRow in newSupplyOrders.Rows) { SqlCreate sqlCreate = new SqlCreate("AS_SC_HANDLESUPPLY", SqlType.INSERT); sqlCreate.AppendQuote("ORDERDATE", dataRow["ORDERDATE"]); sqlCreate.AppendQuote("BATCHNO", dataRow["BATCHNO"]); sqlCreate.AppendQuote("LINECODE", dataRow["LINECODE"]); sqlCreate.Append("SORTNO", dataRow["SORTNO"]); sqlCreate.AppendQuote("SUPPLYBATCH", dataRow["SUPPLYBATCH"]); sqlCreate.AppendQuote("ORDERID", dataRow["ORDERID"]); sqlCreate.AppendQuote("CIGARETTECODE", dataRow["CIGARETTECODE"]); sqlCreate.AppendQuote("CIGARETTENAME", dataRow["CIGARETTENAME"]); sqlCreate.AppendQuote("CHANNELCODE", dataRow["CHANNELCODE"]); sqlCreate.Append("QUANTITY", dataRow["QUANTITY"]); sqlCreate.AppendQuote("STATUS", "0"); ExecuteNonQuery(sqlCreate.GetSQL()); } }
public void InsertNewSupplyOrders(DataTable newSupplyOrders) { foreach (DataRow dataRow in newSupplyOrders.Rows) { SqlCreate sqlCreate = new SqlCreate("AS_SC_ORDER", SqlType.INSERT); sqlCreate.AppendQuote("ORDERDATE", dataRow["ORDERDATE"]); sqlCreate.AppendQuote("BATCHNO", dataRow["BATCHNO"]); sqlCreate.AppendQuote("LINECODE", dataRow["LINECODE"]); sqlCreate.Append("SORTNO", dataRow["SORTNO"]); sqlCreate.AppendQuote("ORDERID", dataRow["ORDERID"]); sqlCreate.Append("ORDERNO", dataRow["ORDERNO"]); sqlCreate.AppendQuote("CIGARETTECODE", dataRow["CIGARETTECODE"]); sqlCreate.AppendQuote("CIGARETTENAME", dataRow["CIGARETTENAME"]); sqlCreate.AppendQuote("CHANNELCODE", dataRow["CHANNELCODE"]); sqlCreate.AppendQuote("CHANNELGROUP", dataRow["CHANNELGROUP"]); sqlCreate.AppendQuote("CHANNELORDER", dataRow["CHANNELORDER"]); sqlCreate.Append("QUANTITY", dataRow["QUANTITY"]); sqlCreate.Append("EXPORTNO", dataRow["EXPORTNO"]); sqlCreate.Append("PACKNO", dataRow["PACKNO"]); ExecuteNonQuery(sqlCreate.GetSQL()); } }
public void Update(DataRow row) { SqlCreate sqlCreate = new SqlCreate("SHELF", SqlType.UPDATE); sqlCreate.AppendQuote("SHELFNAME", row["SHELFNAME"]); sqlCreate.Append("SHELFCOLUMN", row["SHELFCOLUMN"]); sqlCreate.Append("SHELFROW", row["SHELFROW"]); sqlCreate.AppendQuote("CRANENO", row["CRANENO"]); sqlCreate.AppendQuote("MEMO", row["MEMO"]); sqlCreate.AppendWhereQuote("SHELFCODE", row["SHELFCODE"]); ExecuteNonQuery(sqlCreate.GetSQL()); }
public void InserMaster(string formulaCode, string formulaName, string formulaDate, string cigaretteName, string quantity, string formulaNo, string operater) { SqlCreate sqlCreate = new SqlCreate("FORMULAMASTER", SqlType.INSERT); sqlCreate.AppendQuote("FORMULACODE", formulaCode); sqlCreate.AppendQuote("FORMULANAME", formulaName); sqlCreate.Append("FORMULADATE", string.Format("TO_DATE('{0}','YYYY-MM-DD')", formulaDate)); sqlCreate.AppendQuote("CIGARETTENAME", THOKUtil.ToDBC(cigaretteName)); sqlCreate.Append("USECOUNT", quantity); sqlCreate.Append("FORMULANO", formulaNo); sqlCreate.AppendQuote("OPERATER", operater); ExecuteNonQuery(sqlCreate.GetSQL()); }
public void Insert(DataRow row) { SqlCreate sqlCreate = new SqlCreate("SHELF", SqlType.INSERT); sqlCreate.AppendQuote("SHELFCODE", row["SHELFCODE"]); sqlCreate.AppendQuote("SHELFNAME", row["SHELFNAME"]); sqlCreate.Append("SHELFCOLUMN", row["SHELFCOLUMN"]); sqlCreate.Append("SHELFROW", row["SHELFROW"]); sqlCreate.AppendQuote("WAREHOUSECODE", row["WAREHOUSECODE"]); sqlCreate.AppendQuote("AREACODE", row["AREACODE"]); sqlCreate.AppendQuote("CRANENO", row["CRANENO"]); sqlCreate.AppendQuote("MEMO", row["MEMO"]); ExecuteNonQuery(sqlCreate.GetSQL()); }
internal void InsertDetail(string billNo, DataTable detailTable) { int itemNo = 1; foreach (DataRow row in detailTable.Rows) { SqlCreate sqlCreate = new SqlCreate("PALLETDETAIL", SqlType.INSERT); sqlCreate.AppendQuote("BILLNO", billNo); sqlCreate.Append("ITEMNO", itemNo++); sqlCreate.AppendQuote("PRODUCTCODE", row["PRODUCTCODE"]); sqlCreate.Append("QUANTITY", row["QUANTITY"]); sqlCreate.Append("PACKAGECOUNT", row["PACKAGECOUNT"]); string sql = sqlCreate.GetSQL(); ExecuteNonQuery(sql); } }
/// <summary> /// 更新 /// </summary> /// <param name="dataSet"></param> public void UpdateEntity(string sortID, string areaCode) { SqlCreate sqlCreate = new SqlCreate("AS_BI_AREA", SqlType.UPDATE); sqlCreate.Append("SORTID", sortID); sqlCreate.AppendWhereQuote("AREACODE", areaCode); ExecuteNonQuery(sqlCreate.GetSQL()); }
/// <summary> /// ¸üР/// </summary> /// <param name="dataSet"></param> public void UpdateEntity(string sortID,string lineCode,string routeCode) { SqlCreate sqlCreate = new SqlCreate("AS_BI_ROUTE", SqlType.UPDATE); sqlCreate.Append("SORTID", sortID); sqlCreate.AppendQuote("LINECODE", lineCode); sqlCreate.AppendWhereQuote("ROUTECODE", routeCode); ExecuteNonQuery(sqlCreate.GetSQL()); }
public void Insert(string billCode, string billName, int billType, int taskLevel, string memo) { SqlCreate sqlCreate = new SqlCreate("BILLTYPE", SqlType.INSERT); sqlCreate.AppendQuote("BILLCODE", billCode); sqlCreate.AppendQuote("BILLNAME", billName); sqlCreate.AppendQuote("BTYPE", billType); sqlCreate.Append("TASKLEVEL", taskLevel); sqlCreate.AppendQuote("CANDELETE", "1"); sqlCreate.AppendQuote("MEMO", memo); ExecuteNonQuery(sqlCreate.GetSQL()); }
public void Update(string billCode, string billName, int billType, int taskLevel, string memo) { SqlCreate sqlCreate = new SqlCreate("BILLTYPE", SqlType.UPDATE); sqlCreate.AppendQuote("BILLNAME", billName); sqlCreate.AppendQuote("BTYPE", billType); sqlCreate.Append("TASKLEVEL", taskLevel); sqlCreate.AppendQuote("MEMO", memo); sqlCreate.AppendWhereQuote("BILLCODE", billCode); ExecuteNonQuery(sqlCreate.GetSQL()); }
/// <summary> /// 2010-11-21 /// </summary> /// <param name="channelTable"></param> public void UpdateChannel(DataTable channelTable) { foreach (DataRow row in channelTable.Rows) { SqlCreate sqlCreate = new SqlCreate("AS_BI_STOCKCHANNEL", SqlType.UPDATE); sqlCreate.AppendQuote("CIGARETTECODE", row["CIGARETTECODE"]); sqlCreate.AppendQuote("CIGARETTENAME", row["CIGARETTENAME"]); sqlCreate.Append("QUANTITY", row["QUANTITY"]); sqlCreate.AppendWhereQuote("CHANNELCODE", row["CHANNELCODE"]); ExecuteNonQuery(sqlCreate.GetSQL()); } }
/// <summary> /// 2010-11-21 /// </summary> /// <param name="supplyTable"></param> /// <param name="orderDate"></param> /// <param name="lineCode"></param> public void InsertSupply(DataTable supplyTable, string orderDate, string lineCode) { if (this.lineCode != lineCode) { this.lineCode = lineCode; string sql = string.Format("SELECT CASE WHEN MAX(SERIALNO) IS NULL THEN 1000 ELSE MAX(SERIALNO) END FROM AS_SC_SUPPLY WHERE ORDERDATE='{0}' AND LINECODE='{1}'", orderDate, lineCode); serialNo = Convert.ToInt32(ExecuteScalar(sql)); } foreach (DataRow row in supplyTable.Rows) { SqlCreate sqlCreate = new SqlCreate("AS_SC_SUPPLY", SqlType.INSERT); sqlCreate.AppendQuote("ORDERDATE", row["ORDERDATE"]); sqlCreate.Append("BATCHNO", row["BATCHNO"]); sqlCreate.AppendQuote("LINECODE", row["LINECODE"]); sqlCreate.Append("SORTNO", row["SORTNO"]); sqlCreate.Append("SERIALNO", serialNo++); sqlCreate.Append("ORIGINALSORTNO", row["SORTNO"]); sqlCreate.AppendQuote("CIGARETTECODE", row["CIGARETTECODE"]); sqlCreate.AppendQuote("CIGARETTENAME", row["CIGARETTENAME"]); sqlCreate.AppendQuote("CHANNELCODE", row["CHANNELCODE"]); sqlCreate.Append("CHANNELGROUP", row["CHANNELGROUP"]); sqlCreate.Append("GROUPNO", row["GROUPNO"]); ExecuteNonQuery(sqlCreate.GetSQL()); } }
/// <summary> /// 2010-11-21 /// </summary> /// <param name="supplyTable"></param> public void InsertSupply(DataTable supplyTable,bool isUseSerialNo) { DataRow[] rows = supplyTable.Select("", "BATCH,SERIALNO"); int serialNo = 1; foreach (DataRow row in rows) { SqlCreate sqlCreate = new SqlCreate("AS_SC_SUPPLY", SqlType.INSERT); sqlCreate.AppendQuote("ORDERDATE", row["ORDERDATE"]); sqlCreate.Append("BATCHNO", row["BATCHNO"]); sqlCreate.AppendQuote("LINECODE", row["LINECODE"]); sqlCreate.Append("SERIALNO", isUseSerialNo ? row["SERIALNO"] : serialNo++); sqlCreate.Append("ORIGINALSORTNO", row["SORTNO"]); sqlCreate.Append("SORTNO", row["SORTNO"]); sqlCreate.AppendQuote("CIGARETTECODE", row["CIGARETTECODE"]); sqlCreate.AppendQuote("CIGARETTENAME", row["CIGARETTENAME"]); sqlCreate.AppendQuote("CHANNELCODE", row["CHANNELCODE"]); sqlCreate.Append("CHANNELGROUP", row["CHANNELGROUP"]); sqlCreate.Append("GROUPNO", row["GROUPNO"]); ExecuteNonQuery(sqlCreate.GetSQL()); } }
/// <summary> /// 2010-11-19 /// </summary> /// <param name="lineTable"></param> public void SaveLineSchedule(DataTable lineTable) { foreach (DataRow lineRow in lineTable.Rows) { SqlCreate sqlCreate = new SqlCreate("AS_SC_LINE", SqlType.INSERT); sqlCreate.AppendQuote("LINECODE", lineRow["LINECODE"]); sqlCreate.AppendQuote("ROUTECODE", lineRow["ROUTECODE"]); sqlCreate.Append("QUANTITY", lineRow["QUANTITY"]); sqlCreate.AppendQuote("BATCHNO", lineRow["BATCHNO"]); sqlCreate.AppendQuote("ORDERDATE", lineRow["ORDERDATE"]); string sql = sqlCreate.GetSQL(); ExecuteNonQuery(sql); } }
internal void InsertMaster(DataRow masterRow, string userID) { SqlCreate sqlCreate = new SqlCreate("PALLETMASTER", SqlType.INSERT); sqlCreate.AppendQuote("BILLNO", masterRow["BILLNO"]); sqlCreate.Append("BILLDATE", string.Format("TO_DATE('{0}', 'YYYY-MM-DD')", masterRow["BILLDATE"])); sqlCreate.AppendQuote("BILLTYPE", masterRow["BILLTYPE"]); sqlCreate.AppendQuote("WAREHOUSECODE", masterRow["WAREHOUSECODE"]); sqlCreate.AppendQuote("TARGET", masterRow["TARGET"]); sqlCreate.AppendQuote("STATUS", masterRow["STATUS"]); sqlCreate.AppendQuote("STATE", masterRow["STATE"]); sqlCreate.AppendQuote("OPERATER", userID); sqlCreate.Append("OPERATEDATE", "SYSDATE"); ExecuteNonQuery(sqlCreate.GetSQL()); }
//public void SaveOrder(DataTable orderTable) //{ // foreach (DataRow orderRow in orderTable.Rows) // { // SqlCreate sql = new SqlCreate("AS_SC_ORDER", SqlType.INSERT); // sql.AppendQuote("ORDERDATE", orderRow["ORDERDATE"]); // sql.Append("BATCHNO", orderRow["BATCHNO"]); // sql.AppendQuote("LINECODE", orderRow["LINECODE"]); // sql.Append("SORTNO", orderRow["SORTNO"]); // sql.Append("PALLETNO", orderRow["PALLETNO"]); // sql.AppendQuote("CHANNELCODE", orderRow["CHANNELCODE"]); // sql.AppendQuote("CIGARETTECODE", orderRow["CIGARETTECODE"]); // sql.AppendQuote("CIGARETTENAME", orderRow["CIGARETTENAME"]); // sql.Append("QUANTITY", orderRow["QUANTITY"]); // ExecuteNonQuery(sql.GetSQL()); // } //} public void SaveOrderMaster(DataTable masterTable) { foreach (DataRow orderRow in masterTable.Rows) { SqlCreate sql = new SqlCreate("AS_SC_PALLETMASTER", SqlType.INSERT); sql.AppendQuote("ORDERDATE", orderRow["ORDERDATE"]); sql.Append("BATCHNO", orderRow["BATCHNO"]); sql.AppendQuote("LINECODE", orderRow["LINECODE"]); sql.Append("SORTNO", orderRow["SORTNO"]); sql.AppendQuote("ORDERID", orderRow["ORDERID"]); sql.AppendQuote("AREACODE", orderRow["AREACODE"]); sql.AppendQuote("AREANAME", orderRow["AREANAME"]); sql.AppendQuote("ROUTECODE", orderRow["ROUTECODE"]); sql.AppendQuote("ROUTENAME", orderRow["ROUTENAME"]); sql.AppendQuote("CUSTOMERCODE", orderRow["CUSTOMERCODE"]); sql.AppendQuote("CUSTOMERNAME", orderRow["CUSTOMERNAME"]); sql.AppendQuote("ADDRESS", orderRow["ADDRESS"]); sql.AppendQuote("ORDERNO", orderRow["ORDERNO"]); sql.Append("QUANTITY", orderRow["QUANTITY"]); sql.Append("ABNORMITY_QUANTITY", orderRow["ABNORMITY_QUANTITY"]); ExecuteNonQuery(sql.GetSQL()); } }
/// <summary> /// 2010-11-21 todo /// </summary> /// <param name="masterTable"></param> /// <param name="tableName"></param> public void SaveOrderMaster(DataTable masterTable, string tableName) { foreach (DataRow orderRow in masterTable.Rows) { SqlCreate sql = new SqlCreate(tableName, SqlType.INSERT); sql.AppendQuote("ORDERDATE", orderRow["ORDERDATE"]); sql.Append("BATCHNO", orderRow["BATCHNO"]); sql.AppendQuote("LINECODE", orderRow["LINECODE"]); sql.Append("SORTNO", orderRow["SORTNO"]); sql.AppendQuote("ORDERID", orderRow["ORDERID"]); sql.AppendQuote("AREACODE", orderRow["AREACODE"]); sql.AppendQuote("AREANAME", orderRow["AREANAME"]); sql.AppendQuote("ROUTECODE", orderRow["ROUTECODE"]); sql.AppendQuote("ROUTENAME", orderRow["ROUTENAME"]); sql.AppendQuote("CUSTOMERCODE", orderRow["CUSTOMERCODE"]); sql.AppendQuote("CUSTOMERNAME", orderRow["CUSTOMERNAME"]); sql.AppendQuote("LICENSENO", orderRow["LICENSENO"]); sql.AppendQuote("ADDRESS", orderRow["ADDRESS"]); sql.AppendQuote("CUSTOMERSORTNO", orderRow["CUSTOMERSORTNO"]); sql.AppendQuote("ORDERNO", orderRow["ORDERNO"]); sql.Append("QUANTITY", orderRow["QUANTITY"]); sql.Append("QUANTITY1", orderRow["QUANTITY1"]); sql.Append("ABNORMITY_QUANTITY", orderRow["ABNORMITY_QUANTITY"]); sql.Append("EXPORTNO", orderRow["EXPORTNO"]); sql.Append("EXPORTNO1", orderRow["EXPORTNO1"]); sql.AppendQuote("PACKNO", orderRow["PACKNO"]); sql.AppendQuote("PACKNO1", orderRow["PACKNO1"]); ExecuteNonQuery(sql.GetSQL()); } }
public void InsertMaster(string billNo, string billDate, string billType, string scheduleNo, string oriBillNo, string warehouseCode, string target, string status, string state, string userID) { SqlCreate sqlCreate = new SqlCreate("BILLMASTER", SqlType.INSERT); sqlCreate.AppendQuote("BILLNO", billNo); sqlCreate.Append("BILLDATE", String.Format("TO_DATE('{0}','YYYY-MM-DD')", billDate)); sqlCreate.AppendQuote("BILLTYPE", billType); sqlCreate.AppendQuote("SCHEDULENO", scheduleNo); sqlCreate.AppendQuote("ORIBILLNO", oriBillNo); sqlCreate.AppendQuote("WAREHOUSECODE", warehouseCode); sqlCreate.AppendQuote("TARGET", target); sqlCreate.AppendQuote("STATUS", status); sqlCreate.AppendQuote("STATE", state); sqlCreate.AppendQuote("OPERATER", userID); sqlCreate.Append("OPERATEDATE", "SYSDATE"); string sql = sqlCreate.GetSQL(); ExecuteNonQuery(sql); }
public void InsertDetail(string billNo, DataTable detailTable) { bool hasOtherCode = detailTable.Columns.Contains("OTHERCODE"); int itemNo = 1; foreach (DataRow row in detailTable.Rows) { SqlCreate sqlCreate = new SqlCreate("BILLDETAIL", SqlType.INSERT); sqlCreate.AppendQuote("BILLNO", billNo); sqlCreate.Append("ITEMNO", itemNo++); sqlCreate.AppendQuote("PRODUCTCODE", row["PRODUCTCODE"]); sqlCreate.Append("QUANTITY", row["QUANTITY"]); sqlCreate.Append("PACKAGECOUNT", row["PACKAGECOUNT"]); sqlCreate.Append("NCCOUNT", row["NCCOUNT"]); if (hasOtherCode) sqlCreate.AppendQuote("OTHERCODE", row["OTHERCODE"]); string sql = sqlCreate.GetSQL(); ExecuteNonQuery(sql); } }
public void Insert(string billNo, string billType, int itemNo, DataRow stateRow) { SqlCreate sqlCreate = new SqlCreate("PRODUCTSTATE", SqlType.INSERT); sqlCreate.AppendQuote("BILLNO", billNo); sqlCreate.Append("ITEMNO", itemNo); sqlCreate.AppendQuote("SCHEDULENO", stateRow["SCHEDULENO"]); sqlCreate.AppendQuote("PRODUCTCODE", stateRow["PRODUCTCODE"]); sqlCreate.Append("QUANTITY", stateRow["QUANTITY"]); sqlCreate.Append("REALQUANTITY", stateRow["REALQUANTITY"]); sqlCreate.AppendQuote("BARCODE", stateRow["BARCODE"]); if (billType == "007")//���ݳ��ⵥ�����˿ⵥ { sqlCreate.AppendQuote("PALLETBARCODE", ""); sqlCreate.AppendQuote("CELLCODE", ""); sqlCreate.AppendQuote("NEWCELLCODE", ""); } else if (billType == "002")//������ⵥ���ɳ��ⵥ { sqlCreate.AppendQuote("PALLETBARCODE", stateRow["PALLETBARCODE"]); sqlCreate.AppendQuote("CELLCODE", stateRow["CELLCODE"]); sqlCreate.AppendQuote("NEWCELLCODE", stateRow["NEWCELLCODE"]); } sqlCreate.Append("TOTALCOUNT", 0); sqlCreate.AppendQuote("ISMIX", stateRow["ISMIX"]); string sql = sqlCreate.GetSQL(); ExecuteNonQuery(sql); }
public void SaveAlcoholizeDetail(string billNo, DataTable detailTable) { int itemNo = 1; foreach (DataRow row in detailTable.Rows) { switch (row.RowState) { case DataRowState.Added: SqlCreate sqlCreate = new SqlCreate("BILLDETAIL", SqlType.INSERT); sqlCreate.AppendQuote("BILLNO", billNo); sqlCreate.Append("ITEMNO", itemNo++); sqlCreate.AppendQuote("PRODUCTCODE", row["PRODUCTCODE"]); sqlCreate.Append("QUANTITY", row["REALQUANTITY"]); sqlCreate.Append("PACKAGECOUNT", row["PACKAGECOUNT"]); sqlCreate.Append("NCCOUNT", row["NCCOUNT"]); ExecuteNonQuery(sqlCreate.GetSQL()); break; case DataRowState.Modified: string sql = ""; if (row["OTHERCODE"].ToString().Trim().Length != 0) sql = string.Format("UPDATE BILLDETAIL SET PACKAGECOUNT={0},NCCOUNT={1},QUANTITY={2} WHERE BILLNO='{3}' AND PRODUCTCODE='{4}'", row["PACKAGECOUNT"], row["NCCOUNT"], row["QUANTITY"], billNo, row["PRODUCTCODE"]); else sql = string.Format("UPDATE BILLDETAIL SET PACKAGECOUNT={0},NCCOUNT={1} WHERE BILLNO='{2}' AND PRODUCTCODE='{3}'", row["PACKAGECOUNT"], row["NCCOUNT"], billNo, row["PRODUCTCODE"]); ExecuteNonQuery(sql); break; } } }
public int Insert(string billNo, string scheduleNo, int itemNo, string productCode, string quantity, string userID, string mixID) { SqlCreate sqlCreate = new SqlCreate("PRODUCTSTATE", SqlType.INSERT); sqlCreate.AppendQuote("BILLNO", billNo); sqlCreate.Append("ITEMNO", itemNo); sqlCreate.AppendQuote("SCHEDULENO", scheduleNo); sqlCreate.AppendQuote("PRODUCTCODE", productCode); sqlCreate.Append("QUANTITY", quantity); sqlCreate.AppendQuote("BARCODE", ""); sqlCreate.Append("TOTALCOUNT", 0); sqlCreate.AppendQuote("OUTBILLNO", ""); sqlCreate.AppendQuote("USERID", userID); sqlCreate.AppendQuote("MIXID", mixID); string sql = sqlCreate.GetSQL(); return ExecuteNonQuery(sql); }
public void Insert(string billNo, DataTable stateTable) { bool hasIsMix = stateTable.Columns.Contains("ISMIX"); int itemNo = 1; foreach (DataRow row in stateTable.Rows) { row["BILLNO"] = billNo; SqlCreate sqlCreate = new SqlCreate("PRODUCTSTATE", SqlType.INSERT); sqlCreate.AppendQuote("BILLNO", billNo); sqlCreate.Append("ITEMNO", itemNo++); sqlCreate.AppendQuote("SCHEDULENO", row["SCHEDULENO"]); sqlCreate.AppendQuote("PRODUCTCODE", row["PRODUCTCODE"]); sqlCreate.Append("QUANTITY", row["QUANTITY"]); if (row["REALQUANTITY"].ToString().Trim().Length != 0) sqlCreate.Append("REALQUANTITY", row["REALQUANTITY"]); else sqlCreate.Append("REALQUANTITY", 0); sqlCreate.AppendQuote("BARCODE", row["BARCODE"]); sqlCreate.AppendQuote("PALLETBARCODE", row["PALLETBARCODE"]); sqlCreate.AppendQuote("CELLCODE", row["CELLCODE"]); sqlCreate.AppendQuote("NEWCELLCODE", row["NEWCELLCODE"]); sqlCreate.Append("TOTALCOUNT", 0); if (hasIsMix) sqlCreate.AppendQuote("ISMIX", row["ISMIX"]); string sql = sqlCreate.GetSQL(); ExecuteNonQuery(sql); } }
public void Insert(string billNo, string scheduleNo, DataTable table, string userID) { foreach (DataRow row in table.Rows) { string sql = null; switch (row.RowState) { case DataRowState.Added: SqlCreate sqlCreate = new SqlCreate("PRODUCTSTATE", SqlType.INSERT); sqlCreate.AppendQuote("BILLNO", billNo); sqlCreate.Append("ITEMNO", row["ITEMNO"]); sqlCreate.AppendQuote("SCHEDULENO", scheduleNo); sqlCreate.AppendQuote("PRODUCTCODE", row["PRODUCTCODE"]); sqlCreate.Append("QUANTITY", row["QUANTITY"]); sqlCreate.Append("TOTALCOUNT", 0); sqlCreate.AppendQuote("ISMIX", row["ISMIX"]); sqlCreate.AppendQuote("USERID", userID); ExecuteNonQuery(sqlCreate.GetSQL()); break; case DataRowState.Modified: //sql = string.Format("UPDATE PRODUCTSTATE SET QUANTITY={0},ISMIX='{1}' WHERE BILLNO='{2}' AND ITEMNO={3}", // row["QUANTITY"], row["ISMIX"], row["BILLNO"], row["ITEMNO"]); sql = string.Format("UPDATE PRODUCTSTATE SET QUANTITY={0},ISMIX='{1}' WHERE BILLNO='{2}' AND ITEMNO={3} AND PRODUCTCODE = '{4}'", row["QUANTITY"], row["ISMIX"], row["BILLNO"], row["ITEMNO"], row["PRODUCTCODE"]); ExecuteNonQuery(sql); break; case DataRowState.Deleted: sql = string.Format("DELETE FROM PRODUCTSTATE WHERE BILLNO='{0}' AND ITEMNO={1}", row["BILLNO", DataRowVersion.Original], row["ITEMNO", DataRowVersion.Original]); ExecuteNonQuery(sql); break; } } }
public void Insert(string billNo, string scheduleNo, int itemNo, string productCode, string quantity, string cellCode) { SqlCreate sqlCreate = new SqlCreate("PRODUCTSTATE", SqlType.INSERT); sqlCreate.AppendQuote("BILLNO", billNo); sqlCreate.Append("ITEMNO", itemNo); sqlCreate.AppendQuote("SCHEDULENO", scheduleNo); sqlCreate.AppendQuote("PRODUCTCODE", productCode); sqlCreate.Append("QUANTITY", quantity); sqlCreate.AppendQuote("BARCODE", ""); sqlCreate.Append("TOTALCOUNT", 0); sqlCreate.AppendQuote("OUTBILLNO", ""); sqlCreate.AppendQuote("CELLCODE", cellCode); string sql = sqlCreate.GetSQL(); ExecuteNonQuery(sql); }
public void UpdateMaster2(DataRow masterRow) { SqlCreate sqlCreate = new SqlCreate("BILLMASTER", SqlType.UPDATE); sqlCreate.AppendQuote("SCHEDULENO", masterRow["SCHEDULENO"]); sqlCreate.AppendQuote("OPERATER", masterRow["OPERATER"]); sqlCreate.Append("OPERATEDATE", string.Format("TO_DATE('{0}','YYYY-MM-DD')", masterRow["OPERATEDATE"])); sqlCreate.AppendWhereQuote("BILLNO", masterRow["BILLNO"]); ExecuteNonQuery(sqlCreate.GetSQL()); }
public void UpdateMasterState(string billNo, string state, string userField, string userID, string dateField, string date) { SqlCreate sqlCreate = new SqlCreate("BILLMASTER", SqlType.UPDATE); sqlCreate.AppendQuote("STATE", state); sqlCreate.AppendQuote(userField, userID); if (date.Trim().Length == 0) sqlCreate.AppendQuote(dateField, ""); else sqlCreate.Append(dateField, string.Format("TO_DATE('{0}','YYYY-MM-DD')", date)); sqlCreate.AppendWhereQuote("BILLNO", billNo); ExecuteNonQuery(sqlCreate.GetSQL()); }
/// <summary> /// 2010-11-21 todo /// </summary> /// <param name="orderTable"></param> /// <param name="tableName"></param> public void SaveOrderSchedule(DataTable orderTable, string tableName) { foreach (DataRow orderRow in orderTable.Rows) { SqlCreate sql = new SqlCreate(tableName, SqlType.INSERT); sql.Append("SORTNO", orderRow["SORTNO"]); sql.AppendQuote("LINECODE", orderRow["LINECODE"]); sql.AppendQuote("BATCHNO", orderRow["BATCHNO"]); sql.AppendQuote("ORDERID", orderRow["ORDERID"]); sql.Append("ORDERNO", orderRow["ORDERNO"]); sql.AppendQuote("ORDERDATE", orderRow["ORDERDATE"]); sql.AppendQuote("CIGARETTECODE", orderRow["CIGARETTECODE"]); sql.AppendQuote("CIGARETTENAME", orderRow["CIGARETTENAME"]); sql.AppendQuote("CHANNELCODE", orderRow["CHANNELCODE"]); sql.Append("QUANTITY", orderRow["QUANTITY"]); sql.Append("CHANNELGROUP", orderRow["CHANNELGROUP"]); sql.Append("CHANNELORDER", orderRow["CHANNELORDER"]); sql.Append("EXPORTNO", orderRow["EXPORTNO"]); sql.AppendQuote("PACKNO", orderRow["PACKNO"]); ExecuteNonQuery(sql.GetSQL()); } }
public void Update(string balanceID, string state, string userID, string balanceDate) { SqlCreate sqlCreate = new SqlCreate("BALANCEMASTER", SqlType.UPDATE); sqlCreate.AppendQuote("STATE", state); sqlCreate.AppendQuote("OPERATER", userID); if (balanceDate != null) sqlCreate.Append("BALANCEDATE", string.Format("TO_DATE('{0}', 'YYYY-MM-DD')", balanceDate)); else sqlCreate.AppendQuote("BALANCEDATE", ""); sqlCreate.AppendWhereQuote("BALANCEID", balanceID); ExecuteNonQuery(sqlCreate.GetSQL()); }
internal void UpdateMaster(string billNo, string operater) { SqlCreate sqlCreate = new SqlCreate("PALLETMASTER", SqlType.UPDATE); sqlCreate.AppendQuote("OPERATER", operater); sqlCreate.Append("OPERATEDATE", "SYSDATE"); sqlCreate.AppendWhereQuote("BILLNO", billNo); ExecuteNonQuery(sqlCreate.GetSQL()); }