Exemplo n.º 1
0
        public bool updateData(mtermofpayment 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 tblmtermofpayment SET DAYS=@Days,TERMTYPE=@TermType,ACTIVE=@Active WHERE TERMOFPAYMENT=@TermOfPayment";
                strQuery.Parameters.AddWithValue("@TermOfPayment", k.TermOfPayment);
                strQuery.Parameters.AddWithValue("@TERMTYPE", k.TermType);
                strQuery.Parameters.AddWithValue("@Days", k.Days);
                strQuery.Parameters.AddWithValue("@Active", k.Active);
                strQuery.ExecuteNonQuery();
                ConnG.Putus();
                stat = true;
            }
            catch
            {
            }
            return(stat);
        }
Exemplo n.º 2
0
        public bool insertData(mtermofpayment 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 tblmtermofpayment VALUES(@TermOfPayment,@Days,@TermType,@Active)";
                strQuery.Parameters.AddWithValue("@TermOfPayment", k.TermOfPayment);
                strQuery.Parameters.AddWithValue("@Days", k.Days);
                strQuery.Parameters.AddWithValue("@TermType", k.TermType);
                strQuery.Parameters.AddWithValue("@Active", k.Active);
                strQuery.ExecuteNonQuery();
                stat = true;
                ConnG.Putus();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            return(stat);
        }