Exemplo n.º 1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            int id = int.Parse(Request.QueryString["id"]);
            Employee emp = new Employee();
            emp.findById(id);
            int check = emp.delete();

            if (check == 1)
            {
                Response.Redirect("Employees.aspx");
            }
            else {
                header1.showAlert("Something went wrong");
            }
        }
Exemplo n.º 2
0
        public ArrayList getALL()
        {
            clartItems();
            DatabaseHandler handler = new DatabaseHandler();
            handler.setSQL("SELECT        employee_id AS Expr1, employee_lastName FROM            Employee WHERE        (employee_working_status = 1) ORDER BY employee_lastName");
            handler.queryExecute();

            while (handler.reader.Read()) {
                int employee_id = int.Parse(handler.reader["Expr1"].ToString());
                Employee e = new Employee();
                e.findById(employee_id);
                items.Add(e);
            }

            return items;
        }
Exemplo n.º 3
0
        public ArrayList getApproved()
        {
            clartItems();
            DatabaseHandler handler = new DatabaseHandler();
            handler.setSQL("SELECT employee_id FROM Employee WHERE (employee_approved = @status) ORDER BY employee_lastName");
            handler.addParameter("@status", "TRUE");
            handler.queryExecute();

            while (handler.reader.Read())
            {
                int employee_id = int.Parse(handler.reader["employee_id"].ToString());
                Employee e = new Employee();
                e.findById(employee_id);
                items.Add(e);
            }

            return items;
        }
        public ArrayList getALL()
        {
            clartItems();
            DatabaseHandler handler = new DatabaseHandler();

            handler.setSQL("SELECT        employee_id AS Expr1, employee_lastName FROM            Employee WHERE        (employee_working_status = 1) ORDER BY employee_lastName");
            handler.queryExecute();

            while (handler.reader.Read())
            {
                int      employee_id = int.Parse(handler.reader["Expr1"].ToString());
                Employee e           = new Employee();
                e.findById(employee_id);
                items.Add(e);
            }

            return(items);
        }
        public ArrayList getApproved()
        {
            clartItems();
            DatabaseHandler handler = new DatabaseHandler();

            handler.setSQL("SELECT employee_id FROM Employee WHERE (employee_approved = @status) ORDER BY employee_lastName");
            handler.addParameter("@status", "TRUE");
            handler.queryExecute();

            while (handler.reader.Read())
            {
                int      employee_id = int.Parse(handler.reader["employee_id"].ToString());
                Employee e           = new Employee();
                e.findById(employee_id);
                items.Add(e);
            }


            return(items);
        }
        public ArrayList findByName(string name)
        {
            clartItems();
            DatabaseHandler handler = new DatabaseHandler();

            handler.setSQL("SELECT employee_id FROM Employee WHERE (employee_name like '%" + name + "%') ORDER BY employee_lastName");
            handler.addParameter("@status", "False");
            handler.queryExecute();

            while (handler.reader.Read())
            {
                int      employee_id = int.Parse(handler.reader["employee_id"].ToString());
                Employee e           = new Employee();
                e.findById(employee_id);
                items.Add(e);
            }


            return(items);
        }