Ejemplo n.º 1
0
        public bool updateData(joborder k)
        {
            bool stat = false;

            try
            {
                Connection ConnG = new Connection();
                ConnG.Konek();
                strQuery             = new MySql.Data.MySqlClient.MySqlCommand();
                strQuery.Connection  = ConnG.Conn;
                strQuery.CommandType = CommandType.Text;
                strQuery.CommandText = "UPDATE tbljoborder SET ORDERNO=@ORDERNO,QUANTITY=@QUANTITY,ITEMSID=@ITEMSID,GDIV=@GDIV, " +
                                       " POCUSTOMER=@POCUSTOMER,TYPEID=@TYPEID,CATEGORYID=@CATEGORYID,DATE=@DATE,OFFICER=@OFFICER,CUSTVENDCODE=@CUSTVENDCODE,ADDRESS=@ADDRESS," +
                                       " DELIVERYDATE=@DELIVERYDATE,DELIVERY=@DELIVERY,REMARKS=@REMARKS,APPROVE=@APPROVE,APPROVEDATE=@APPROVEDATE, " +
                                       " APPROVEBY=@APPROVEBY,WASH=@WASH" +
                                       " WHERE ORDERNO=@ORDERNO";
                strQuery.Parameters.AddWithValue("@ORDERNO", k.ORDERNO);
                strQuery.Parameters.AddWithValue("@QUANTITY", k.QUANTITY);
                strQuery.Parameters.AddWithValue("@ITEMSID", k.ITEMSID);
                strQuery.Parameters.AddWithValue("@GDIV", k.GDIV);
                strQuery.Parameters.AddWithValue("@TYPEID", k.TYPEID);
                strQuery.Parameters.AddWithValue("@CATEGORYID", k.CATEGORYID);
                strQuery.Parameters.AddWithValue("@POCUSTOMER", k.POCUSTOMER);
                strQuery.Parameters.AddWithValue("@DATE", k.DATE);
                strQuery.Parameters.AddWithValue("@OFFICER", k.OFFICER);
                strQuery.Parameters.AddWithValue("@CUSTVENDCODE", k.CUSTVENDCODE);
                strQuery.Parameters.AddWithValue("@ADDRESS", k.ADDRESS);
                strQuery.Parameters.AddWithValue("@DELIVERYDATE", k.DELIVERYDATE);
                strQuery.Parameters.AddWithValue("@DELIVERY", k.DELIVERY);
                strQuery.Parameters.AddWithValue("@REMARKS", k.REMARKS);
                strQuery.Parameters.AddWithValue("@APPROVE", k.APPROVE);
                strQuery.Parameters.AddWithValue("@APPROVEDATE", k.APPROVEDATE);
                strQuery.Parameters.AddWithValue("@APPROVEBY", k.APPROVEBY);
                strQuery.Parameters.AddWithValue("@WASH", k.WASH);

                strQuery.ExecuteNonQuery();

                ConnG.Putus();
                stat = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            return(stat);
        }
Ejemplo n.º 2
0
        public bool insertData(joborder k)
        {
            bool stat = false;

            try
            {
                Connection ConnG = new Connection();
                ConnG.Konek();
                strQuery             = new MySql.Data.MySqlClient.MySqlCommand();
                strQuery.Connection  = ConnG.Conn;
                strQuery.CommandType = CommandType.Text;

                strQuery.CommandText = "INSERT INTO tbljoborder(ORDERNO,QUANTITY,ITEMSID,GDIV,POCUSTOMER,TYPEID,CATEGORYID,DATE,OFFICER,CUSTVENDCODE,ADDRESS,DELIVERYDATE,DELIVERY,REMARKS,APPROVE,APPROVEDATE,APPROVEBY,WASH) " +
                                       " VALUES(@ORDERNO,@QUANTITY,@ITEMSID,@GDIV,@POCUSTOMER,@TYPEID,@CATEGORYID,@DATE,@OFFICER,@CUSTVENDCODE,@ADDRESS,@DELIVERYDATE,@DELIVERY,@REMARKS,@APPROVE,@APPROVEDATE,@APPROVEBY,@WASH)";
                strQuery.Parameters.AddWithValue("@ORDERNO", k.ORDERNO);
                strQuery.Parameters.AddWithValue("@QUANTITY", k.QUANTITY);
                strQuery.Parameters.AddWithValue("@ITEMSID", k.ITEMSID);
                strQuery.Parameters.AddWithValue("@GDIV", k.GDIV);
                strQuery.Parameters.AddWithValue("@TYPEID", k.TYPEID);
                strQuery.Parameters.AddWithValue("@CATEGORYID", k.CATEGORYID);
                strQuery.Parameters.AddWithValue("@POCUSTOMER", k.POCUSTOMER);
                strQuery.Parameters.AddWithValue("@DATE", k.DATE);
                strQuery.Parameters.AddWithValue("@OFFICER", k.OFFICER);
                strQuery.Parameters.AddWithValue("@CUSTVENDCODE", k.CUSTVENDCODE);
                strQuery.Parameters.AddWithValue("@ADDRESS", k.ADDRESS);
                strQuery.Parameters.AddWithValue("@DELIVERYDATE", k.DELIVERYDATE);
                strQuery.Parameters.AddWithValue("@DELIVERY", k.DELIVERY);
                strQuery.Parameters.AddWithValue("@REMARKS", k.REMARKS);
                strQuery.Parameters.AddWithValue("@APPROVE", k.APPROVE);
                strQuery.Parameters.AddWithValue("@APPROVEDATE", k.APPROVEDATE);
                strQuery.Parameters.AddWithValue("@APPROVEBY", k.APPROVEBY);
                strQuery.Parameters.AddWithValue("@WASH", k.WASH);
                strQuery.ExecuteNonQuery();
                stat = true;
                ConnG.Putus();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            return(stat);
        }