Esempio n. 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (txtQtyType.Text.Trim() == "")
            {
                MessageBox.Show("Quantity Type Required");
                return;
            }

            cQuanTypes qtyType = new cQuanTypes(0, txtQtyType.Text, dtpDtAdd.Value.ToString());

            if (qtyType.checkQuanType())
            {
                MessageBox.Show("This quantity type already exits!");
                return;
            }

            if (qtyType.SaveRecord())
            {
                txtQtyType.Clear();
                MessageBox.Show("Saved");
            }
        }
Esempio n. 2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (txtQtyType.Text.Trim() == "")
            {
                MessageBox.Show("Quantitiy type required");
                return;
            }

            cQuanTypes qtyT = new cQuanTypes();

            qtyT.QuanTypeID = Convert.ToUInt32(dgvQtyT["QuanTypeID", dgvQtyT.CurrentCell.RowIndex].Value);
            qtyT.QuanType = txtQtyType.Text;
            qtyT.DateAdded = dtpDtAdd.Value.ToString();

            if (qtyT.checkQuanType())
            {
                MessageBox.Show("This quantity type already exits!");
                return;
            }

            if (qtyT.SaveRecord())
            {
                MessageBox.Show("Saved");
                txtQtyType.Clear();
            }
            LoadQuanTypes();
        }