Esempio n. 1
0
        public bool updateData(gin 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 tblgin SET GINNO=@GINNO,GDIV=@GDIV,DATE=@DATE,OFFICER=@OFFICER,DELIVERYTO=@DELIVERYTO,REMARKS=@REMARKS,"+
                 *      "STOREID=@STOREID,APPROVE=@APPROVE,APPROVEDATE=@APPROVEDATE,APPROVEBY=@APPROVEBY,CLOSE=@CLOSE,CUSTVENDCODE=@CUSTVENDCODE,DELIVERYTONAME=@DELIVERYTONAME,"+
                 *      "DELIVERYTOADDRESS=@DELIVERYTOADDRESS,DOCREGNO=@DOCREGNO,TYPE=@TYPE,"+
                 *      " WHERE GINNO=@GINNO";
                 */
                strQuery.CommandText = "UPDATE tblgin SET GINNO=@GINNO,GDIV=@GDIV,DATE=@DATE,OFFICER=@OFFICER,DELIVERYTO=@DELIVERYTO,REMARKS=@REMARKS," +
                                       "STOREID=@STOREID,APPROVE=@APPROVE,APPROVEDATE=@APPROVEDATE,APPROVEBY=@APPROVEBY,CLOSE=@CLOSE,CUSTVENDCODE=@CUSTVENDCODE,DELIVERYTONAME=@DELIVERYTONAME," +
                                       "DELIVERYTOADDRESS=@DELIVERYTOADDRESS,DOCREGNO=@DOCREGNO,TYPE=@TYPE " +
                                       " WHERE GINNO=@GINNO";

                strQuery.Parameters.AddWithValue("@GINNO", k.GINNO);
                strQuery.Parameters.AddWithValue("@GDIV", k.GDIV);
                strQuery.Parameters.AddWithValue("@DATE", k.DATE);
                strQuery.Parameters.AddWithValue("@OFFICER", k.OFFICER);
                strQuery.Parameters.AddWithValue("@DELIVERYTO", k.DELIVERYTO);
                strQuery.Parameters.AddWithValue("@REMARKS", k.REMARKS);
                strQuery.Parameters.AddWithValue("@STOREID", k.STOREID);
                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("@CUSTVENDCODE", k.CUSTVENDCODE);
                strQuery.Parameters.AddWithValue("@DELIVERYTONAME", k.DELIVERYTONAME);
                strQuery.Parameters.AddWithValue("@DELIVERYTOADDRESS", k.DELIVERYTOADDRESS);
                strQuery.Parameters.AddWithValue("@DOCREGNO", k.DOCREGNO);
                strQuery.Parameters.AddWithValue("@TYPE", k.TYPE);
                strQuery.ExecuteNonQuery();

                ConnG.Putus();
                stat = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            return(stat);
        }
Esempio n. 2
0
        public bool insertData(gin 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 tblgin VALUES(@GINNO,@GDIV,@DATE,@OFFICER,@DELIVERYTO,@REMARKS," +
                                       "@STOREID,@APPROVE,@APPROVEDATE,@APPROVEBY,@CLOSE,@CUSTVENDCODE,@DELIVERYTONAME,@DELIVERYTOADDRESS,@DOCREGNO,@TYPE" +
                                       ")";
                strQuery.Parameters.AddWithValue("@GINNO", k.GINNO);
                strQuery.Parameters.AddWithValue("@GDIV", k.GDIV);
                strQuery.Parameters.AddWithValue("@DATE", k.DATE);
                strQuery.Parameters.AddWithValue("@OFFICER", k.OFFICER);
                strQuery.Parameters.AddWithValue("@DELIVERYTO", k.DELIVERYTO);
                strQuery.Parameters.AddWithValue("@REMARKS", k.REMARKS);
                strQuery.Parameters.AddWithValue("@STOREID", k.STOREID);
                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("@CUSTVENDCODE", k.CUSTVENDCODE);
                strQuery.Parameters.AddWithValue("@DELIVERYTONAME", k.DELIVERYTONAME);
                strQuery.Parameters.AddWithValue("@DELIVERYTOADDRESS", k.DELIVERYTOADDRESS);
                strQuery.Parameters.AddWithValue("@DOCREGNO", k.DOCREGNO);
                strQuery.Parameters.AddWithValue("@TYPE", k.TYPE);


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