Exemplo n.º 1
0
        public bool updateData(grndetail k, string GRNNo, int ID)
        {
            bool stat = false;

            try
            {
                Connection ConnG = new Connection();
                ConnG.Konek();
                strQuery             = new MySqlCommand();
                strQuery.Connection  = ConnG.Conn;
                strQuery.CommandType = CommandType.Text;
                strQuery.CommandText = "UPDATE tblgrndetail SET GRNNO=@GRNNO,ID=@ID,ITEMSID=@ITEMSID,DESCRIPTION=@DESCRIPTION,JENIS=@JENIS,COLORID=@COLORID,SIZEID=@SIZEID,GRADE=@GRADE,STYLEID=@STYLEID,PONO=@PONO,QUANTITY=@QUANTITY,UOM=@UOM,CONVER=@CONVER,QTYPURCHASE=@QTYPURCHASE,UOMPURCHASE=@UOMPURCHASE" +
                                       " WHERE GRNNO=@GRNNO1 AND ID=@ID1";
                strQuery.Parameters.AddWithValue("@GRNNO", k.GRNNO);
                strQuery.Parameters.AddWithValue("@ID", k.ID);
                strQuery.Parameters.AddWithValue("@ITEMSID", k.ITEMSID);
                strQuery.Parameters.AddWithValue("@DESCRIPTION", k.DESCRIPTION);
                strQuery.Parameters.AddWithValue("@JENIS", k.JENIS);
                strQuery.Parameters.AddWithValue("@COLORID", k.COLORID);
                strQuery.Parameters.AddWithValue("@SIZEID", k.SIZEID);
                strQuery.Parameters.AddWithValue("@GRADE", k.GRADE);
                strQuery.Parameters.AddWithValue("@STYLEID", k.STYLEID);
                strQuery.Parameters.AddWithValue("@PONO", k.PONO);
                strQuery.Parameters.AddWithValue("@QUANTITY", k.QUANTITY);
                strQuery.Parameters.AddWithValue("@UOM", k.UOM);
                strQuery.Parameters.AddWithValue("@CONVER", k.CONVER);
                strQuery.Parameters.AddWithValue("@QTYPURCHASE", k.QTYPURCHASE);
                strQuery.Parameters.AddWithValue("@UOMPURCHASE", k.UOMPURCHASE);
                //key
                strQuery.Parameters.AddWithValue("@GRNNO1", GRNNo);
                strQuery.Parameters.AddWithValue("@ID1", ID);


                strQuery.ExecuteNonQuery();

                ConnG.Putus();
                stat = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            return(stat);
        }
Exemplo n.º 2
0
        public bool insertData(grndetail 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 tblgrndetail (GRNNO,ID,ITEMSID,DESCRIPTION,JENIS,COLORID,SIZEID,GRADE,STYLEID,PONO,QUANTITY,UOM,CONVER,QTYPURCHASE,UOMPURCHASE) " +
                                       " VALUES(@GRNNO,@ID,@ITEMSID,@DESCRIPTION,@JENIS,@COLORID,@SIZEID,@GRADE,@STYLEID,@PONO,@QUANTITY,@UOM,@CONVER,@QTYPURCHASE,@UOMPURCHASE)";
                strQuery.Parameters.AddWithValue("@GRNNO", k.GRNNO);
                strQuery.Parameters.AddWithValue("@ID", k.ID);
                strQuery.Parameters.AddWithValue("@ITEMSID", k.ITEMSID);
                strQuery.Parameters.AddWithValue("@DESCRIPTION", k.DESCRIPTION);
                strQuery.Parameters.AddWithValue("@JENIS", k.JENIS);
                strQuery.Parameters.AddWithValue("@COLORID", k.COLORID);
                strQuery.Parameters.AddWithValue("@SIZEID", k.SIZEID);
                strQuery.Parameters.AddWithValue("@GRADE", k.GRADE);
                strQuery.Parameters.AddWithValue("@STYLEID", k.STYLEID);
                strQuery.Parameters.AddWithValue("@PONO", k.PONO);
                strQuery.Parameters.AddWithValue("@QUANTITY", k.QUANTITY);
                strQuery.Parameters.AddWithValue("@UOM", k.UOM);
                strQuery.Parameters.AddWithValue("@CONVER", k.CONVER);
                strQuery.Parameters.AddWithValue("@QTYPURCHASE", k.QTYPURCHASE);
                strQuery.Parameters.AddWithValue("@UOMPURCHASE", k.UOMPURCHASE);



                strQuery.ExecuteNonQuery();
                stat = true;
                ConnG.Putus();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            return(stat);
        }