Exemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            #region all statements of add informations



            if (txtname.Text != string.Empty)
            {
                #region paramter

                con.Open();
                string name = txtname.Text;
                Halls  c1   = new Halls();
                c1.Name = txtname.Text;

                #endregion

                c1.add1(c1);
                con.Close();
            }

            else
            {
                MessageBox.Show("Please make sure that you have entered all the information");
            }


            #endregion
        }
        private void button3_Click(object sender, EventArgs e)
        {
            con.Open();
            Halls  c1   = new Halls();
            string name = combhall.Text;

            c1.delete1(name);
            con.Close();
        }
Exemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            con.Open();

            #region paramter

            Halls  c1   = new Halls();
            string name = combhall.Text;

            #endregion
            dgv_search_cust.DataSource = c1.search1(name);
            con.Close();
        }
        public displayhall()
        {
            InitializeComponent();
            con.Open();

            #region paramter

            Halls c1 = new Halls();

            #endregion

            dgv_display_cust.DataSource = c1.display1();

            con.Close();
        }
Exemplo n.º 5
0
        public void edit1(Halls c1, string n)
        {
            try
            {
                #region Paramters

                SqlCommand cmd;

                #endregion

                con.Open();
                cmd = new SqlCommand("update Halls set Halls_Name='" + c1.Name + "'where Halls_Name='" + n + "'", con);
                cmd.ExecuteNonQuery();
                MessageBox.Show("Your Update was sucsessful");
                con.Close();
            }
            catch (Exception)
            {
                MessageBox.Show("Please check Name ");
            }
        }
Exemplo n.º 6
0
        public void add1(Halls c2)
        {
            try
            {
                #region Paramters

                SqlCommand cmd;

                #endregion

                con.Open();
                cmd = new SqlCommand("insert into Halls (Halls_Name) values ('" + c2.Name + "') ", con);
                cmd.ExecuteNonQuery();
                MessageBox.Show("Your Registeration was sucsessful");
                con.Close();
            }
            catch (Exception)
            {
                MessageBox.Show("Please check Name ");
            }
        }