コード例 #1
0
        public bool updateData(invoice k)
        {
            bool stat = false;

            try
            {
                Connection ConnG = new Connection();
                ConnG.Konek();
                strQuery             = new MySqlCommand();
                strQuery.Connection  = ConnG.Conn;
                strQuery.CommandType = CommandType.Text;
                strQuery.CommandText = "UPDATE tblinvoice SET INVNO=@GRNNO,DATE=@DATE,OFFICER=@OFFICER,GDIV=@GDIV,RECEIVEFROM=@RECEIVEFROM,REMARKS=@REMARKS, " +
                                       " STOREID=@STOREID,PONO=@PONO,CUSTVENDCODE=@CUSTVENDCODE,REFFNO=@REFFNO,APPROVE=@APPROVE,APPROVEDATE=@APPROVEDATE, " +
                                       " APPROVEBY=@APPROVEBY,CLOSE=@CLOSE,STYLEID=@STYLEID,COLORID=@COLORID,DOCREGNO=@DOCREGNO,JENIS=@JENIS" +
                                       " WHERE INVNO=@INVNO";
                strQuery.Parameters.AddWithValue("@GRNNO", k.INVNO);
                strQuery.Parameters.AddWithValue("@DATE", k.DATE);
                strQuery.Parameters.AddWithValue("@OFFICER", k.OFFICER);
                strQuery.Parameters.AddWithValue("@GDIV", k.GDIV);
                strQuery.Parameters.AddWithValue("@RECEIVEFROM", k.RECEIVEFROM);
                strQuery.Parameters.AddWithValue("@REMARKS", k.REMARKS);
                strQuery.Parameters.AddWithValue("@STOREID", k.STOREID);
                strQuery.Parameters.AddWithValue("@PONO", k.PONO);
                strQuery.Parameters.AddWithValue("@CUSTVENDCODE", k.CUSTVENDCODE);
                strQuery.Parameters.AddWithValue("@REFFNO", k.REFFNO);
                strQuery.Parameters.AddWithValue("@APPROVE", k.APPROVE);
                strQuery.Parameters.AddWithValue("@APPROVEDATE", k.APPROVEDATE);
                strQuery.Parameters.AddWithValue("@APPROVEBY", k.APPROVEBY);
                strQuery.Parameters.AddWithValue("@CLOSE", k.CLOSE);
                strQuery.Parameters.AddWithValue("@STYLEID", k.STYLEID);
                strQuery.Parameters.AddWithValue("@COLORID", k.COLORID);
                strQuery.Parameters.AddWithValue("@DOCREGNO", k.DOCREGNO);
                strQuery.Parameters.AddWithValue("@JENIS", k.JENIS);
                strQuery.ExecuteNonQuery();

                ConnG.Putus();
                stat = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            return(stat);
        }
コード例 #2
0
        public bool insertData(invoice 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 tblinvoice (INVNO,DATE,OFFICER,GDIV,RECEIVEFROM,REMARKS,STOREID,PONO,CUSTVENDCODE,REFFNO,APPROVE,APPROVEDATE,APPROVEBY,CLOSE,STYLEID,COLORID,DOCREGNO,JENIS) " +
                                       "VALUES (@GRNNO,@DATE,@OFFICER,@GDIV,@RECEIVEFROM,@REMARKS,@STOREID,@PONO,@CUSTVENDCODE,@REFFNO,@APPROVE,@APPROVEDATE,@APPROVEBY,@CLOSE,@STYLEID,@COLORID,@DOCREGNO,@JENIS)";
                strQuery.Parameters.AddWithValue("@GRNNO", k.INVNO);
                strQuery.Parameters.AddWithValue("@DATE", k.DATE);
                strQuery.Parameters.AddWithValue("@OFFICER", k.OFFICER);
                strQuery.Parameters.AddWithValue("@GDIV", k.GDIV);
                strQuery.Parameters.AddWithValue("@RECEIVEFROM", k.RECEIVEFROM);
                strQuery.Parameters.AddWithValue("@REMARKS", k.REMARKS);
                strQuery.Parameters.AddWithValue("@STOREID", k.STOREID);
                strQuery.Parameters.AddWithValue("@PONO", k.PONO);
                strQuery.Parameters.AddWithValue("@CUSTVENDCODE", k.CUSTVENDCODE);
                strQuery.Parameters.AddWithValue("@REFFNO", k.REFFNO);
                strQuery.Parameters.AddWithValue("@APPROVE", k.APPROVE);
                strQuery.Parameters.AddWithValue("@APPROVEDATE", k.APPROVEDATE);
                strQuery.Parameters.AddWithValue("@APPROVEBY", k.APPROVEBY);
                strQuery.Parameters.AddWithValue("@CLOSE", k.CLOSE);
                strQuery.Parameters.AddWithValue("@STYLEID", k.STYLEID);
                strQuery.Parameters.AddWithValue("@COLORID", k.COLORID);
                strQuery.Parameters.AddWithValue("@DOCREGNO", k.DOCREGNO);
                strQuery.Parameters.AddWithValue("@JENIS", k.JENIS);
                strQuery.ExecuteNonQuery();
                stat = true;
                ConnG.Putus();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            return(stat);
        }