示例#1
0
        public bool insertData(mconvert 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 tblmconvert(UOM,UOMCONVERT,CONVER) VALUES(@UOM,@UOMCONVERT,@CONVER)";
                strQuery.Parameters.AddWithValue("@UOM", k.UOM);
                strQuery.Parameters.AddWithValue("@UOMCONVERT", k.UOMCONVERT);
                strQuery.Parameters.AddWithValue("@CONVER", k.CONVER);
                strQuery.ExecuteNonQuery();
                stat = true;
                ConnG.Putus();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            return(stat);
        }
示例#2
0
        public bool updateData(mconvert 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 tblmconvert SET CONVER=@CONVER WHERE UOM=@UOM,UOMCONVERT=@UOMCONVERT";
                strQuery.Parameters.AddWithValue("@UOM", k.UOM);
                strQuery.Parameters.AddWithValue("@UOMCONVERT", k.UOMCONVERT);
                strQuery.Parameters.AddWithValue("@CONVER", k.CONVER);
                strQuery.ExecuteNonQuery();

                ConnG.Putus();
                stat = true;
            }
            catch
            {
            }
            return(stat);
        }