예제 #1
0
        private void btn_Save_Click(object sender, EventArgs e)
        {
            try
            {
                AvocatBLL.Classes.Tribunal Trib = new AvocatBLL.Classes.Tribunal();
                Trib.name    = txtBox_City.Text;
                Trib.city    = txtBox_Name.Text;
                Trib.address = txtBox_Address.Text;

                int res = 1;
                Trib.save_Tribunal();

                if (res.Equals(1))
                {
                    MessageBox.Show("Court Added Succefully");
                }
                else
                {
                    MessageBox.Show("There was a probleme");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
예제 #2
0
        private void Configuration_Load(object sender, EventArgs e)
        {
            AvocatBLL.Classes.Tribunal AvocBLLJuridition = new AvocatBLL.Classes.Tribunal();
            DataTable dt = AvocBLLJuridition.loadTribunal();

            //listBoxJuridiction.DataSource = AvocBLLJuridition.loadTribunal();
            //listBoxJuridiction.DisplayMember = "Name";
            //listBoxJuridiction.ValueMember = "ID_Trib";
            foreach (DataRow row in dt.Rows)
            {
                string name = row["name"].ToString();
                string city = row["city"].ToString();
                listBoxJuridiction.Items.Add(string.Format("{0} | {1}", name, city));
            }
        }