示例#1
0
        private void csRecord_Click(object sender, EventArgs e)
        {
            optn = 1;

            Customer_Value instance = new Customer_Value();
            DataTable      tbl      = new DataTable();

            tbl = instance.Customer_Record();
            tjGridview.DataSource = tbl;
        }
示例#2
0
        private void csInfo_update_Click(object sender, EventArgs e)
        {
            //to update the info of the cutomer like Name or contact weather you want
            Customer_Value instance = new Customer_Value();

            if (instance.Customer_Updte(Convert.ToInt32(rentalInfo_csID.Text.ToString()), csInfo_Name.Text, csInfo_email.Text, csInfo_Contact.Text, csInfo_City.Text) == 1)
            {
                csInfo_City.Text     = "";
                csInfo_Contact.Text  = "";
                csInfo_email.Text    = "";
                csInfo_Name.Text     = "";
                rentalInfo_csID.Text = "";
            }
        }
示例#3
0
        private void csInfo_delete_Click(object sender, EventArgs e)
        {
            //to delete the customer we must have to check weather he has issued a movie or not
            Customer_Value instance = new Customer_Value();

            DataTable tbl = new DataTable();

            tbl = instance.Record("select * from Rental_Field where Cust_Id=" + Convert.ToInt32(rentalInfo_csID.Text.ToString()) + " &&  Return_Date='Issue'");
            if (tbl.Rows.Count == 0)
            {
                if (instance.Customer_Delete(Convert.ToInt32(rentalInfo_csID.Text.ToString())) == 1)
                {
                    csInfo_City.Text     = "";
                    csInfo_Contact.Text  = "";
                    csInfo_email.Text    = "";
                    csInfo_Name.Text     = "";
                    rentalInfo_csID.Text = "";
                }
            }
            else
            {
                MessageBox.Show("First Return the Movie then you can ");
            }
        }
示例#4
0
        private void csInfo_Add_Click(object sender, EventArgs e)
        {
            //creating the local instance of the customer class to pass the value to store and verify
            Customer_Value instance = new Customer_Value();

            if (instance.Customer_Insert(csInfo_Name.Text, csInfo_email.Text, csInfo_Contact.Text, csInfo_City.Text) == 1)
            {
                csInfo_City.Text    = "";
                csInfo_Contact.Text = "";
                csInfo_email.Text   = "";
                csInfo_Name.Text    = "";

                DataTable tbl = new DataTable();
                tbl = instance.Customer_Record();
                tjGridview.DataSource = tbl;
            }
            else
            {
                csInfo_City.Text    = "";
                csInfo_Contact.Text = "";
                csInfo_email.Text   = "";
                csInfo_Name.Text    = "";
            }
        }
示例#5
0
        private void csBest_Click(object sender, EventArgs e)
        {
            Customer_Value instance = new Customer_Value();

            MessageBox.Show("Best Customer of the Store :" + instance.Best_Customer());
        }