Пример #1
0
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            register register = new register();

            register.MdiParent = this.MdiParent;
            register.Show();
            this.Hide();
        }
Пример #2
0
        private void registerbtn_Click(object sender, EventArgs e)
        {
            register r = new register();

            r.Show();
        }
Пример #3
0
        //Add or Update button for staff
        private void button3_Click(object sender, EventArgs e)
        {
            //---------------Validation of fields--------------------------
            if (admintxt1.Text.Trim().Length < 1)
            {
                errorProvider1.SetError(admintxt1, "Please Enter Staff Name");
                return;
            }
            else
            {
                errorProvider1.Clear();
            }

            if (admintxt2.Text.Trim().Length < 1)
            {
                errorProvider1.SetError(admintxt2, "Please Enter Mobile Number");
                return;
            }
            else
            {
                errorProvider1.Clear();
            }

            if (admintxt3.Text.Trim().Length < 1)
            {
                errorProvider1.SetError(admintxt3, "Please Enter Email Id");
                return;
            }
            else
            {
                errorProvider1.Clear();
            }

            if (admintxt4.Text.Trim().Length < 1)
            {
                errorProvider1.SetError(admintxt4, "Please Enter Password");
                return;
            }
            else
            {
                errorProvider1.Clear();
            }

            if (admintxt5.Text.Trim().Length < 1)
            {
                errorProvider1.SetError(admintxt5, "Please Enter Address");
                return;
            }
            else
            {
                errorProvider1.Clear();
            }
            //----------------------------------------------------------------------------------------------

            string op = "";

            if (checkBox2.Checked == true)
            {
                op = "insert";
            }
            else
            {
                op = "update";
            }

            register update = new register();

            if (update.registerAddUpdate(op, adminlbl.Text, admintxt1.Text, admintxt2.Text, admintxt3.Text, admintxt4.Text, admintxt5.Text))
            {
                adminres.Text = "successfully updated";
                clearAddUpdateGrp();
            }
            else
            {
                adminres.Text = "Error Updating Data.Try Again!";
                clearAddUpdateGrp();
            }
            unAllocatedDisp();
            tableDisplay();
            update = null;
        }