public DataTable ReadPosList() { DataTable ReadListTable = null; CConnectSQL ConnectSQL = new CConnectSQL(); ReadListTable = ConnectSQL.SQLReadData("select dl_id, dl_artname, dl_qua, dl_pricenet, dl_pricebrt, dl_dhid, MAX(dl_id) as maxID from dl_mdokl where dl_dhid = " + ID + " GROUP BY dl_id order by dl_id "); SaveTableAsList(ReadListTable); ReadMaxID(); return(ReadListTable); }
public DataTable ReadList() { DataTable ReadListTable = null; CConnectSQL ConnectSQL = new CConnectSQL(); ReadListTable = ConnectSQL.SQLReadData("select * from dh_mdokh where dh_id > 0 order by dh_id"); SaveTableAsList(ReadListTable); return(ReadListTable); }
public bool EditPosLine(int ID, int MAINID, string ArtName, int Quantity, double PriceNet, double PriceBrt) { if (ID == 0) { return(false); } else { string Request = "Update dl_mdokl SET dl_id = " + ID + " , dl_dhid = " + MAINID + ", dl_artname = '" + ArtName + "', dl_qua = " + Quantity + " , dl_pricenet = " + PriceNet.ToString().Replace(",", ".") + ", dl_pricebrt = " + PriceBrt.ToString().Replace(",", ".") + " where dl_id = " + ID + " ;"; CConnectSQL ConnectSQL = new CConnectSQL(); return(ConnectSQL.SQLQueryExc(Request)); } }
public bool EditListLine(int ID, DateTime DATIN, string Name, int CustNR, double PriceNET, double PriceBRT) { if (ID == 0) { return(false); } else { string Request = "Update dh_mdokh SET dh_id = " + ID + " , dh_datin = '" + DATIN + "', dh_name = '" + Name + "', dh_custnr = " + CustNR + " , dh_pricenet = " + PriceNET.ToString().Replace(",", ".") + ", dh_pricebrt = " + PriceBRT.ToString().Replace(",", ".") + " where dh_id = " + ID + " ;"; CConnectSQL ConnectSQL = new CConnectSQL(); return(ConnectSQL.SQLQueryExc(Request)); } }
public bool CreatePosLine(int ID, int MAINID, string ArtName, int Quantity, double PriceNet, double PriceBrt) { if (ID == 0) { return(false); } else { string Request = "insert into dl_mdokl(dl_id, dl_artname, dl_qua, dl_dhid , dl_pricenet, dl_pricebrt) values(" + ID + ",'" + ArtName + "'," + Quantity + "," + MAINID + " ," + PriceNet.ToString().Replace(",", ".") + "," + PriceBrt.ToString().Replace(",", ".") + ");"; CConnectSQL ConnectSQL = new CConnectSQL(); return(ConnectSQL.SQLQueryExc(Request)); } }
public bool CreateListLine(int ID, DateTime DATIN, string Name, int CustNR, double PriceNET, double PriceBRT) { if (ID == 0) { return(false); } else { string Request = "insert into dh_mdokh(dh_id,dh_datin, dh_name, dh_custnr , dh_pricenet, dh_pricebrt) values(" + ID + ",'" + DATIN + "','" + Name + "'," + CustNR + " ," + PriceNET.ToString().Replace(",", ".") + "," + PriceBRT.ToString().Replace(",", ".") + ");"; MessageBox.Show(Request); CConnectSQL ConnectSQL = new CConnectSQL(); return(ConnectSQL.SQLQueryExc(Request)); } }
public bool DeletePosLine(int RowLine) { int DeletedID = RowLine; if (DeletedID == 0) { return(false); } else { string Request = "DELETE FROM dl_mdokl WHERE dl_id = " + DeletedID + ";"; CConnectSQL ConnectSQL = new CConnectSQL(); return(ConnectSQL.SQLQueryExc(Request)); } }
public bool DeletePosLines(int RowLine) { int DeletedID = TransactionListLine[RowLine].ID; if (DeletedID == 0) { return(false); } else { string Request = "DELETE FROM dl_mdokl WHERE dl_dhid = " + DeletedID + ";"; CConnectSQL ConnectSQL = new CConnectSQL(); return(ConnectSQL.SQLQueryExc(Request)); } }
private void ReadMaxID() { DataTable ReadListTable = null; CConnectSQL ConnectSQL = new CConnectSQL(); ReadListTable = ConnectSQL.SQLReadData("select MAX(dl_id) as maxID from dl_mdokl GROUP BY dl_id order by dl_id "); foreach (DataRow dr2 in ReadListTable.Rows) { if (!DBNull.Value.Equals(dr2["maxID"])) { MaxID = Convert.ToInt32(dr2["maxID"]); } } }