public bool updateData(eximdoc k, string AJUNO1) { bool stat = false; try { Connection ConnG = new Connection(); ConnG.Konek(); strQuery = new MySqlCommand(); strQuery.Connection = ConnG.Conn; strQuery.CommandType = CommandType.Text; strQuery.CommandText = "UPDATE tbleximdoc SET AJUDATE=@AJUDATE,TRANSNO=@TRANSNO,OFFICER=@OFFICER,DOCNO=@DOCNO,DOCTYPE=@DOCTYPE,DOCREASON=@DOCREASON,DOCDATE=@DOCDATE,INVNO=@INVNO,INVDATE=@INVDATE,BLNO=@BLNO,BLDATE=@BLDATE,TYPE=@TYPE,DATE=@DATE,REMARKS=@REMARKS" + " WHERE AJUNO=@AJUNO1"; //key strQuery.Parameters.AddWithValue("@AJUNO1", AJUNO1); //strQuery.Parameters.AddWithValue("@AJUNO", AJUNO1); //en key //strQuery.Parameters.AddWithValue("@AJUNO", k.AJUNO); strQuery.Parameters.AddWithValue("@AJUDATE", k.AJUDATE); strQuery.Parameters.AddWithValue("@TRANSNO", k.TRANSNO); strQuery.Parameters.AddWithValue("@OFFICER", k.OFFICER); strQuery.Parameters.AddWithValue("@DOCNO", k.DOCNO); strQuery.Parameters.AddWithValue("@DOCTYPE", k.DOCTYPE); strQuery.Parameters.AddWithValue("@DOCREASON", k.DOCREASON); strQuery.Parameters.AddWithValue("@DOCDATE", k.DOCDATE); strQuery.Parameters.AddWithValue("@INVNO", k.INVNO); strQuery.Parameters.AddWithValue("@INVDATE", k.INVDATE); strQuery.Parameters.AddWithValue("@BLNO", k.BLNO); strQuery.Parameters.AddWithValue("@BLDATE", k.BLDATE); strQuery.Parameters.AddWithValue("@TYPE", k.TYPE); strQuery.Parameters.AddWithValue("@DATE", k.DATE); strQuery.Parameters.AddWithValue("@REMARKS", k.REMARKS); strQuery.ExecuteNonQuery(); ConnG.Putus(); stat = true; } catch (Exception ex) { MessageBox.Show(ex.Message); } return(stat); }
public bool insertData(eximdoc k) { bool stat = false; try { Connection ConnG = new Connection(); ConnG.Konek(); strQuery = new MySqlCommand(); strQuery.Connection = ConnG.Conn; strQuery.CommandType = CommandType.Text; strQuery.CommandText = "INSERT INTO tbleximdoc (AJUNO,AJUDATE,TRANSNO,OFFICER,DOCNO,DOCTYPE,DOCREASON,DOCDATE,INVNO,INVDATE,BLNO,BLDATE,TYPE,DATE,REMARKS) " + "VALUES (@AJUNO,@AJUDATE,@TRANSNO,@OFFICER,@DOCNO,@DOCTYPE,@DOCREASON,@DOCDATE,@INVNO,@INVDATE,@BLNO,@BLDATE,@TYPE,@DATE,@REMARKS)"; strQuery.Parameters.AddWithValue("@AJUNO", k.AJUNO); strQuery.Parameters.AddWithValue("@AJUDATE", k.AJUDATE); strQuery.Parameters.AddWithValue("@TRANSNO", k.TRANSNO); strQuery.Parameters.AddWithValue("@OFFICER", k.OFFICER); strQuery.Parameters.AddWithValue("@DOCNO", k.DOCNO); strQuery.Parameters.AddWithValue("@DOCTYPE", k.DOCTYPE); strQuery.Parameters.AddWithValue("@DOCREASON", k.DOCREASON); strQuery.Parameters.AddWithValue("@DOCDATE", k.DOCDATE); strQuery.Parameters.AddWithValue("@INVNO", k.INVNO); strQuery.Parameters.AddWithValue("@INVDATE", k.INVDATE); strQuery.Parameters.AddWithValue("@BLNO", k.BLNO); strQuery.Parameters.AddWithValue("@BLDATE", k.BLDATE); strQuery.Parameters.AddWithValue("@TYPE", k.TYPE); strQuery.Parameters.AddWithValue("@DATE", k.DATE); strQuery.Parameters.AddWithValue("@REMARKS", k.REMARKS); strQuery.ExecuteNonQuery(); stat = true; ConnG.Putus(); } catch (Exception ex) { MessageBox.Show(ex.Message); } return(stat); }