Пример #1
0
        private void button9_Click(object sender, EventArgs e)
        {
            //Add button
            if (selectname == 1)
            {
                customer c1 = new customer();
                this.Dispose();
                c1.Visible         = true;
                c1.button1.Visible = true;
                c1.button2.Visible = false;
            }
            else if (selectname == 2)
            {
                Orders o1 = new Orders();
                o1.Visible         = true;
                o1.button2.Visible = true;
                o1.button3.Visible = false;
            }
            else if (selectname == 4)
            {
                payHistory ph = new payHistory();
                ph.Visible         = true;
                ph.button1.Visible = true;
                ph.button3.Visible = false;
                //this.Visible = false;
            }

            /*else if (selectname == 3)
             * {
             *
             *  payHistory ph = new payHistory();
             *  ph.Visible = true;
             * }*/

            else
            {
                MessageBox.Show(
                    "Please select right button",
                    "Error window",
                    MessageBoxButtons.OK);
            }
        }
Пример #2
0
        private void button11_Click(object sender, EventArgs e)
        {
            if (selectname == 1)
            {
                customer cu = new customer();
                cu.cusIDlabel.Text  = this.dataGridView1.CurrentRow.Cells[0].Value.ToString();
                cu.Nic.Text         = this.dataGridView1.CurrentRow.Cells[1].Value.ToString();
                cu.name.Text        = this.dataGridView1.CurrentRow.Cells[2].Value.ToString();
                cu.richAddress.Text = this.dataGridView1.CurrentRow.Cells[3].Value.ToString();
                cu.ContNumber.Text  = this.dataGridView1.CurrentRow.Cells[4].Value.ToString();
                cu.Email.Text       = this.dataGridView1.CurrentRow.Cells[5].Value.ToString();
                cu.Show();

                cu.button2.Visible = true;
                cu.button1.Visible = false;
            }
            else if (selectname == 2)
            {
                Orders or = new Orders();
                or.orderIDlabel.Text      = this.dataGridView1.CurrentRow.Cells[0].Value.ToString();
                or.cusIDtextBox.Text      = this.dataGridView1.CurrentRow.Cells[1].Value.ToString();
                or.typecomboBox.Text      = this.dataGridView1.CurrentRow.Cells[2].Value.ToString();
                or.sizecomboBox.Text      = this.dataGridView1.CurrentRow.Cells[3].Value.ToString();
                or.ColortextBox.Text      = this.dataGridView1.CurrentRow.Cells[4].Value.ToString();
                or.DesigntextBox.Text     = this.dataGridView1.CurrentRow.Cells[5].Value.ToString();
                or.QuantytextBox.Text     = this.dataGridView1.CurrentRow.Cells[6].Value.ToString();
                or.ortypecomboBox.Text    = this.dataGridView1.CurrentRow.Cells[7].Value.ToString();
                or.ordateTimePicker.Text  = this.dataGridView1.CurrentRow.Cells[8].Value.ToString();
                or.duedateTimePicker.Text = this.dataGridView1.CurrentRow.Cells[9].Value.ToString();
                or.comstatecomboBox.Text  = this.dataGridView1.CurrentRow.Cells[10].Value.ToString();
                or.fullpaytextBox.Text    = this.dataGridView1.CurrentRow.Cells[11].Value.ToString();
                or.advancetextBox.Text    = this.dataGridView1.CurrentRow.Cells[12].Value.ToString();
                or.labelarrear.Text       = this.dataGridView1.CurrentRow.Cells[13].Value.ToString();
                or.substatuscomboBox.Text = this.dataGridView1.CurrentRow.Cells[15].Value.ToString();
                or.subdatetextBox.Text    = this.dataGridView1.CurrentRow.Cells[14].Value.ToString();
                or.Show();

                or.button3.Visible = true;
                or.button2.Visible = false;
            }
            else if (selectname == 4)
            {
                payHistory ph = new payHistory();
                ph.ortextBox.Text             = this.dataGridView1.CurrentRow.Cells[0].Value.ToString();
                ph.cidlabel.Text              = this.dataGridView1.CurrentRow.Cells[1].Value.ToString();
                ph.tpaylabel.Text             = this.dataGridView1.CurrentRow.Cells[2].Value.ToString();
                ph.advalabel.Text             = this.dataGridView1.CurrentRow.Cells[3].Value.ToString();
                ph.dateTimePicker1.Text       = this.dataGridView1.CurrentRow.Cells[4].Value.ToString();
                ph.labelArear.Text            = this.dataGridView1.CurrentRow.Cells[5].Value.ToString();
                ph.paymethodtextBox.Text      = this.dataGridView1.CurrentRow.Cells[7].Value.ToString();
                ph.rentallabel.Text           = this.dataGridView1.CurrentRow.Cells[6].Value.ToString();
                ph.donecomboBox.Text          = this.dataGridView1.CurrentRow.Cells[10].Value.ToString();
                ph.fullpaystatuscomboBox.Text = this.dataGridView1.CurrentRow.Cells[8].Value.ToString();
                ph.Show();

                ph.button3.Visible = true;
                ph.button1.Visible = false;
            }
            else
            {
                MessageBox.Show("Please select right button", "Error window", MessageBoxButtons.OK);
            }
        }