Ejemplo n.º 1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            DAL.clsRack rc = new DAL.clsRack();

            int er = 0;

            er += txtName.txtValidate();
            er += cmbProduct.txtValidate();

            if (er == 0)
            {
                rc.Name      = txtName.txtTextValue;
                rc.ProductId = cmbProduct.txtTextValueInt;

                if (rc.Insert())
                {
                    MessageBox.Show("Added new Item's On Rack");
                    txtName.txtTextValue       = "";
                    cmbProduct.txtTextValueInt = -1;
                }
                else
                {
                    MessageBox.Show(rc.Error);
                }
            }
        }
Ejemplo n.º 2
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            DAL.clsRack rc = new DAL.clsRack();

            dgvData.DataSource = rc.Select().Tables[0];
        }