Ejemplo n.º 1
0
        public UpdateEmp(vari vi)
        {
            v = vi;
            InitializeComponent();



            List <ViewEmpVar> emplist = new List <ViewEmpVar>();
            //List<Department> departments = new List<Department>();

            SqlDataReader reader = bl.DShowemplist(vi);
            ViewEmpVar    ser    = new ViewEmpVar();

            while (reader.Read())
            {
                // ser.Id = reader.GetInt32(0);
                vi.name       = reader.GetString(1);
                vi.Department = reader.GetString(2);
                vi.salary     = reader.GetString(3);
                //vi.address= reader.GetString(4);
                vi.available = reader.GetString(4);
                vi.address   = reader.GetString(5);
                //emplist.Add(ser);
            }

            // EmpView.DataSource = emplist;

            Ename.Text      = vi.name;
            Department.Text = vi.Department;
            Salary.Text     = vi.salary;
            Address.Text    = vi.address;
            if (vi.available == "Yes")
            {
                Yes.Checked = true;
            }
            else
            {
                No.Checked = true;
            }
        }
        public DeleteEmp(vari d_id)
        {
            InitializeComponent();
            vemp = d_id;

            List <ViewEmpVar> emplist = new List <ViewEmpVar>();
            //List<Department> departments = new List<Department>();

            SqlDataReader reader = bl.DShowemplist(vemp);

            while (reader.Read())
            {
                ViewEmpVar ser = new ViewEmpVar();
                ser.Id         = reader.GetInt32(0);
                ser.Name       = reader.GetString(1);
                ser.Department = reader.GetString(2);
                ser.Salary     = reader.GetString(3);
                ser.Available  = reader.GetString(4);
                emplist.Add(ser);
            }

            dempview.DataSource = emplist;
        }
Ejemplo n.º 3
0
        public Employee()
        {
            InitializeComponent();


            List <ViewEmpVar> emplist = new List <ViewEmpVar>();
            //List<Department> departments = new List<Department>();

            SqlDataReader reader = bl.Showemplist();

            while (reader.Read())
            {
                ViewEmpVar ser = new ViewEmpVar();
                ser.Id         = reader.GetInt32(0);
                ser.Name       = reader.GetString(1);
                ser.Department = reader.GetString(2);
                ser.Salary     = reader.GetString(3);
                ser.Available  = reader.GetString(4);
                ser.Address    = reader.GetString(5);
                emplist.Add(ser);
            }

            EmpView.DataSource = emplist;
        }