private void button1_Click(object sender, EventArgs e) { string plazaID = comboBox_Plaza.SelectedItem.ToString(); string FloorId = comboBox2.SelectedItem.ToString(); string FtId_shopId = comboBox1.SelectedItem.ToString(); string OwnerName = textBox1.Text; string cninc = textBox4.Text; string contactNo = textBox3.Text; string bankName = textBox2.Text; string accNo = textBox5.Text; int owId = FController.getController().addOwner(OwnerName, cninc, DateTime.Today.Date, contactNo, bankName, accNo); if (FController.getController().diffRentiateFlatShop(FtId_shopId)) { // owner of shop FController.getController().addOwnerOfShop(FtId_shopId, owId); } else { // owner of flat FController.getController().addOwnerOfFlat(FtId_shopId, owId); } }
public Add_New_Owner() { InitializeComponent(); SqlDataReader rdr = FController.getController().getAllPlazaIds(); while (rdr.Read()) { comboBox_Plaza.Items.Add(rdr[0].ToString()); } }
private void comboBox_Plaza_SelectedIndexChanged(object sender, EventArgs e) { comboBox2.Items.Clear(); int pid = int.Parse(comboBox_Plaza.SelectedItem.ToString()); SqlDataReader rdr = FController.getController().getFloorsPlaza(pid); while (rdr.Read()) { comboBox2.Items.Add(rdr[0].ToString()); } }
private void btn_addplaza_Click(object sender, EventArgs e) { string plzaName = tb_plazaname.Text; int floors = int.Parse(tb_plazafloors.Text); string loc = tb_plazalocation.Text; string add = tb_plazaaddress.Text; int[] s_f = new int[floors]; for (int i = 0, j = 0; i < this.Controls.Count || j < floors; i++) { // Check this control Control c = this.Controls[i]; if (c.Name == "") { // mujhe apna cntrol ml gya hy jo chyes ab us k bachy dhondne hy int a; // ager ider debuger agay tu control mil gya hy TextBox x = (TextBox)c; s_f[j] = int.Parse(x.Text); j++; } else { // ager ider aya tu ni mila } } int total_flats = 0, total_shops = 0; if (checkBox_basment.Checked) { total_shops += s_f[0]; total_shops += s_f[1]; for (int i = 2; i < floors; i++) { total_flats += s_f[i]; } } else { total_shops += s_f[0]; for (int i = 1; i < floors; i++) { total_flats += s_f[i]; } } FController.getController().addPlaza(plzaName, floors, total_shops, total_flats, add, loc, checkBox_basment.Checked, s_f); }
private void comboBox2_SelectedIndexChanged(object sender, EventArgs e) { comboBox1.Items.Clear(); string fid = comboBox2.SelectedItem.ToString(); SqlDataReader rdr1 = FController.getController().getShopsOfFloor(fid); SqlDataReader rdr2 = FController.getController().getFlatsOfFloor(fid); while (rdr1.Read()) { comboBox1.Items.Add(rdr1[0].ToString()); } while (rdr2.Read()) { comboBox1.Items.Add(rdr2[0].ToString()); } }