Exemplo n.º 1
0
        private void modeData_KeyUp(object sender, KeyEventArgs e)
        {
            string mod = Mode.SelectedItem.ToString();
            string moddata = modeData.Text;

            if(!string.IsNullOrEmpty(moddata))
            {
                List<EmployeeBO> list;

                DataAccesser d = new DataAccesser();
                list = d.getResults(mod , moddata);
                if (list != null)
                {
                    results.ColumnHeadersVisible = true;
                    results.DataSource = list;
                    tcount.Text = list.Count.ToString();
                }
                else
                {
                    results.ColumnHeadersVisible = false;
                    results.DataSource = null;
                    tcount.Text = "0";
                }

            }
            else
            {
                results.ColumnHeadersVisible = false;
                results.DataSource = null;
                tcount.Text = "0";
            }
        }
Exemplo n.º 2
0
        private void submit_Click(object sender, EventArgs e)
        {
            EmployeeBO obj = new EmployeeBO();
            obj.Id = Int32.Parse(tid.Text);
            obj.Name = tname.Text;
            obj.Address = taddress.Text;
            obj.Phone = tphone.Text;
            obj.CNIC = mtcnic.Text;

            DataAccesser d = new DataAccesser();
            if(d.submitResult(obj))
            {
                MessageBox.Show("Employee successfully added");
            }
            else
            {
                MessageBox.Show("Employee not added");
            }
            tid.Text = "";
            tname.Text = "";
            taddress.Text = "";
            tphone.Text = "";
            mtcnic.Text = "";
        }