Exemplo n.º 1
0
    private void loadEmployees()
    {
        try
        {
            ArrayList objDeptEmp = new ArrayList();
            objDeptEmp = (new DepartmentEmployeesController()).List();


            tvEmployeeList.Nodes.Clear();
            TreeNode compnode = new TreeNode(System.Configuration.ConfigurationManager.AppSettings.Get("CompanyName"));
            compnode.Value = System.Configuration.ConfigurationManager.AppSettings.Get("CompanyCode");
            tvEmployeeList.Nodes.Add(compnode);

            if (objDeptEmp.Count > 0)
            {
                int x = 0;
                while (x < objDeptEmp.Count)
                {
                    DepartmentEmployeesInfo di = (DepartmentEmployeesInfo)objDeptEmp[x];
                    TreeNode t = new TreeNode();
                    t.Text  = hrPublicFunction.formatName(di.Lastname) + " " + hrPublicFunction.formatName(di.Fname) + " " + hrPublicFunction.formatName(di.Middlename);
                    t.Value = di.DeptEmpCode.ToString();
                    compnode.ChildNodes.Add(t);

                    x = x + 1;
                }
            }
        }
        catch (Exception ex)
        {
        }
    }
Exemplo n.º 2
0
    private void loadHeads(int DeptId)
    {
        try
        {
            ArrayList obj = new ArrayList();
            obj = (new DepartmentHeadsController()).List();

            if (obj.Count > 0)
            {
                int x = 0;
                while (x < obj.Count)
                {
                    DepartmentHeadInfo di = (DepartmentHeadInfo)obj[x];
                    if (di.DeptId == Convert.ToInt32(ddlDepartment.SelectedValue))
                    {
                        DepartmentEmployeesInfo doi = (new DepartmentEmployeesController()).Get(Convert.ToInt32(di.DeptHead));
                        lbHeads.Items.Add(new ListItem(doi.Ptitle + " " + hrPublicFunction.formatName(doi.Lastname) + " " + hrPublicFunction.formatName(doi.Fname) + " " + hrPublicFunction.formatName(doi.Middlename), di.RecId.ToString()));
                    }
                    x = x + 1;
                }
            }
        }
        catch (Exception ex)
        {
        }
    }
Exemplo n.º 3
0
    private void loadEmployee(String DeptEmpCode)
    {
        try
        {
            DepartmentEmployeesInfo doi = (new DepartmentEmployeesController()).Get(Convert.ToInt32(DeptEmpCode));

            ddlStatus.SelectedValue   = Convert.ToString(doi.EmpStatus);
            ddlEmpDept.SelectedValue  = Convert.ToString(doi.DeptId);
            txtJobTitle.Text          = doi.JobTitle;
            ddlTitle.SelectedValue    = doi.Ptitle;
            txtFName.Text             = hrPublicFunction.formatName(doi.Fname);
            txtMName.Text             = hrPublicFunction.formatName(doi.Middlename);
            txtLName.Text             = hrPublicFunction.formatName(doi.Lastname);
            txtEmail.Text             = doi.Email;
            txtPhnExt.Text            = doi.PhoneExt;
            txtmobNum.Text            = doi.MobileNo;
            txtOfficeRoom.Text        = doi.OfficeRoom;
            rbtnEmpType.SelectedValue = doi.EmpType;
            imgPassport.ImageUrl      = doi.Passport;
            SpecialImageName.Text     = doi.Passport;
            txtUserName.Text          = doi.UserId;
        }
        catch (Exception ex)
        {
        }
    }
Exemplo n.º 4
0
    private void loadEmployee(String DeptEmpCode)
    {
        try
        {
            DepartmentEmployeesInfo doi = (new DepartmentEmployeesController()).Get(Convert.ToInt32(DeptEmpCode));

            DepartmentTableInfo dti = (new DepartmentTableController()).Get(Convert.ToInt32(doi.DeptId));
            imgPassport.ImageUrl = doi.Passport;
            if (doi.EmpType == "1")
            {
                lblEtype.Text = "Employee";
            }
            if (doi.EmpType == "2")
            {
                lblEtype.Text = "Contractor";
            }

            lblName.Text        = doi.Ptitle + " " + hrPublicFunction.formatName(doi.Lastname) + " " + hrPublicFunction.formatName(doi.Fname) + " " + hrPublicFunction.formatName(doi.Middlename);
            lblJob.Text         = doi.JobTitle;
            lblDepartment.Text  = dti.DeptName;
            lblExt.Text         = doi.PhoneExt;
            lblMob.Text         = doi.MobileNo;
            lblOffice.Text      = doi.OfficeRoom;
            hlEmail.Text        = doi.Email;
            hlEmail.NavigateUrl = "mailto:" + doi.Email;

            int CurrHead = getCurrentHead(doi.DeptId);

            if (CurrHead == doi.DeptEmpCode)
            {
                // if employee is head of department, get super Dept head
                DepartmentTableInfo obj     = (new DepartmentTableController()).Get(doi.DeptId);
                int SuperHead               = getCurrentHead(obj.SuperDept);
                DepartmentEmployeesInfo dhi = (new DepartmentEmployeesController()).Get(SuperHead);
                hlBoss.Text        = dhi.Ptitle + " " + hrPublicFunction.formatName(dhi.Lastname) + " " + hrPublicFunction.formatName(dhi.Fname) + " " + hrPublicFunction.formatName(dhi.Middlename);
                hlBoss.NavigateUrl = "#";
            }
            else
            {
                DepartmentEmployeesInfo dhi = (new DepartmentEmployeesController()).Get(CurrHead);
                hlBoss.Text        = dhi.Ptitle + " " + hrPublicFunction.formatName(dhi.Lastname) + " " + hrPublicFunction.formatName(dhi.Fname) + " " + hrPublicFunction.formatName(dhi.Middlename);
                hlBoss.NavigateUrl = "#";
            }
        }
        catch (Exception ex)
        {
        }
    }
Exemplo n.º 5
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            // TODO: create a function to get userid from username in later versions of this app

            //validate record
            if (SpecialImageName.Text == "")
            {
                return;
            }

            //check if record is new record or updating record

            if (DepEmpCode.Text == "")
            {
                //new entry

                try
                {
                    DepartmentEmployeesInfo doi = new DepartmentEmployeesInfo(Convert.ToInt32(ddlStatus.SelectedValue), Convert.ToInt32(ddlEmpDept.SelectedValue), txtJobTitle.Text, ddlTitle.SelectedValue, txtFName.Text, txtMName.Text, txtLName.Text, txtEmail.Text, txtPhnExt.Text, txtmobNum.Text, txtOfficeRoom.Text, rbtnEmpType.SelectedValue, SpecialImageName.Text, txtUserName.Text);
                    int ret = new DepartmentEmployeesController().Add(doi);
                }
                catch (Exception ex)
                {
                }
            }
            else
            {
                //updating an old entry
                DepartmentEmployeesInfo doi = new DepartmentEmployeesInfo(Convert.ToInt32(DepEmpCode.Text), Convert.ToInt32(ddlStatus.SelectedValue), Convert.ToInt32(ddlEmpDept.SelectedValue), txtJobTitle.Text, ddlTitle.SelectedValue, txtFName.Text, txtMName.Text, txtLName.Text, txtEmail.Text, txtPhnExt.Text, txtmobNum.Text, txtOfficeRoom.Text, rbtnEmpType.SelectedValue, SpecialImageName.Text, txtUserName.Text);
                (new DepartmentEmployeesController()).Update(doi);
            }

            //clean up
            //reload listbox
            tvEmployeeList.Nodes.Clear();
            clearSelection();
            loadEmployees();
            panelActiveDirectory.Visible = false;
            bttnAddPersonnel.Visible     = true;
            btnSave.Visible = false;
        }
        catch (Exception ex)
        {
        }
    }
Exemplo n.º 6
0
    private void loadEmployeesbyDept(int DeptId)
    {
        ArrayList objDeptEmp = new ArrayList();

        objDeptEmp = (new DepartmentEmployeesController()).List();

        if (objDeptEmp.Count > 0)
        {
            int x = 0;
            while (x < objDeptEmp.Count)
            {
                DepartmentEmployeesInfo di = (DepartmentEmployeesInfo)objDeptEmp[x];
                if (di.DeptId == DeptId)
                {
                    ddlEmp.Items.Add(new ListItem(di.Ptitle + " " + hrPublicFunction.formatName(di.Lastname) + " " + hrPublicFunction.formatName(di.Fname) + " " + hrPublicFunction.formatName(di.Middlename), di.DeptEmpCode.ToString()));
                }
                x = x + 1;
            }
        }
    }
Exemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            try
            {
                string currUSER             = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo().Username;
                DepartmentEmployeesInfo doi = (new DepartmentEmployeesController()).GetByUserId(currUSER);
                txtSuper.Text = doi.Ptitle + " " + hrPublicFunction.formatName(doi.Lastname) + " " + hrPublicFunction.formatName(doi.Fname) + " " + hrPublicFunction.formatName(doi.Middlename);
                DepartmentTableInfo dti = (new DepartmentTableController()).Get(Convert.ToInt32(doi.DeptId));
                txtDept.Text = dti.DeptName;
                int x = 1;
                while (x < 501)
                {
                    ddlNumber.Items.Add(new ListItem(x.ToString(), x.ToString()));
                    x = x + 1;
                }


                ArrayList objGrades = new ArrayList();
                objGrades = (new EmployeeGradesController()).List();

                if (objGrades.Count > 0)
                {
                    ddlGradeMin.DataSource = objGrades;
                    ddlGradeMax.DataSource = objGrades;

                    ddlGradeMin.DataTextField  = "GradeName";
                    ddlGradeMin.DataValueField = "GradeId";
                    ddlGradeMin.DataBind();

                    ddlGradeMax.DataTextField  = "GradeName";
                    ddlGradeMax.DataValueField = "GradeId";
                    ddlGradeMax.DataBind();
                }
            }
            catch (Exception ex)
            {
            }
        }
    }
Exemplo n.º 8
0
    // USE HRNotification and sendHRNotification

    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            // display user name
            string currUSER             = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo().Username;
            DepartmentEmployeesInfo doi = (new DepartmentEmployeesController()).GetByUserId(currUSER);
            lblName.Text = doi.Ptitle + " " + hrPublicFunction.formatName(doi.Lastname) + " " + hrPublicFunction.formatName(doi.Fname) + " " + hrPublicFunction.formatName(doi.Middlename) + "::  DASHBOARD";
            ArrayList objNotice = new ArrayList();
            objNotice = (new DashBoardNotificationsController()).List(doi.DeptEmpCode);

            if (objNotice.Count > 0)
            {
                gvDashboard.DataSource = objNotice;
                gvDashboard.DataBind();
            }
        }
        catch (Exception ex)
        {
        }
    }
Exemplo n.º 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            try
            {
                panelActiveDirectory.Visible = false;
                ArrayList objDeptEmp = new ArrayList();
                objDeptEmp = (new DepartmentEmployeesController()).List();


                tvEmployeeList.Nodes.Clear();
                TreeNode compnode = new TreeNode(System.Configuration.ConfigurationManager.AppSettings.Get("CompanyName"));
                compnode.Value = System.Configuration.ConfigurationManager.AppSettings.Get("CompanyCode");
                tvEmployeeList.Nodes.Add(compnode);

                if (objDeptEmp.Count > 0)
                {
                    int x = 0;
                    while (x < objDeptEmp.Count)
                    {
                        DepartmentEmployeesInfo di = (DepartmentEmployeesInfo)objDeptEmp[x];
                        TreeNode t = new TreeNode();
                        t.Text  = hrPublicFunction.formatName(di.Lastname) + " " + hrPublicFunction.formatName(di.Fname) + " " + hrPublicFunction.formatName(di.Middlename);
                        t.Value = di.DeptEmpCode.ToString();
                        compnode.ChildNodes.Add(t);

                        x = x + 1;
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
    }
Exemplo n.º 10
0
    protected void bttnSearch_Click(object sender, EventArgs e)
    {
        try
        {
            clearSelection();
            tvEmployeeList.Nodes.Clear();
            panelActiveDirectory.Visible = false;

            if (txtSearch.Text.Trim() == "")
            {
                // show all employees

                ArrayList objDeptEmp = new ArrayList();
                objDeptEmp = (new DepartmentEmployeesController()).List();
                if (objDeptEmp.Count > 0)
                {
                    TreeNode compnode = new TreeNode("Contains  ...." + txtSearch.Text);
                    compnode.Value = System.Configuration.ConfigurationManager.AppSettings.Get("CompanyCode");

                    tvEmployeeList.Nodes.Add(compnode);

                    int x = 0;
                    while (x < objDeptEmp.Count)
                    {
                        DepartmentEmployeesInfo di = (DepartmentEmployeesInfo)objDeptEmp[x];
                        TreeNode t = new TreeNode();
                        t.Text  = hrPublicFunction.formatName(di.Lastname) + " " + hrPublicFunction.formatName(di.Fname) + " " + hrPublicFunction.formatName(di.Middlename);
                        t.Value = di.DeptEmpCode.ToString();
                        compnode.ChildNodes.Add(t);
                        x = x + 1;
                    }
                }
            }
            else
            {
                // search by lastanme
                ArrayList objDeptEmp = new ArrayList();
                objDeptEmp = (new DepartmentEmployeesController()).ListSearch(txtSearch.Text);
                if (objDeptEmp.Count > 0)
                {
                    TreeNode compnode = new TreeNode("Contains  ...." + txtSearch.Text);
                    compnode.Value = System.Configuration.ConfigurationManager.AppSettings.Get("CompanyCode");
                    tvEmployeeList.Nodes.Add(compnode);

                    int x = 0;
                    while (x < objDeptEmp.Count)
                    {
                        DepartmentEmployeesInfo di = (DepartmentEmployeesInfo)objDeptEmp[x];
                        TreeNode t = new TreeNode();
                        t.Text  = hrPublicFunction.formatName(di.Lastname) + " " + hrPublicFunction.formatName(di.Fname) + " " + hrPublicFunction.formatName(di.Middlename);
                        t.Value = di.DeptEmpCode.ToString();
                        compnode.ChildNodes.Add(t);
                        x = x + 1;
                    }
                }
            }
            tvEmployeeList.ExpandAll();
        }
        catch (Exception ex)
        {
        }
    }