/// <summary>
    /// Gets the management users.
    /// </summary>
    /// <returns></returns>
    public List <EmployeePositionData> GetManagementUsers(int clientId, int facility)
    {
        List <EmployeePositionData> lstEmployees = new List <EmployeePositionData>();
        EmployeePositionData        oEmployee    = null;

        param = new List <SqlParameter>();
        param.Add(new SqlParameter("@fa_key", facility));
        param.Add(new SqlParameter("@userID", clientId));

        SqlDataReader oReader = DBOPS.SqlHelper.ExecuteReader(connectionString, CommandType.StoredProcedure, "GetEmployeesToMigrate", param.ToArray());

        if (oReader != null)
        {
            while (oReader.Read())
            {
                oEmployee = new EmployeePositionData();

                oEmployee.EmployeeID = Convert.ToInt32(oReader["USER_ID"]);
                oEmployee.Employee   = Convert.ToString(oReader["UserName"]);

                lstEmployees.Add(oEmployee);
            }

            oReader.Close();
            oReader = null;
        }

        return(lstEmployees);
    }
Exemple #2
0
    /// <summary>
    /// Saves the EmployeePosition and its Access Rights.
    /// </summary>
    /// <returns></returns>
    private int SaveEmployeePosition()
    {
        int result = 0;

        wsEmployeePosition = new WsEmployeePosition();
        EmployeePositionData oEmployeePositionData = ReadEmployeePositionData();

        if (!string.IsNullOrEmpty(oEmployeePositionData.Position))
        {
            result = wsEmployeePosition.SaveEmployeePostion(oEmployeePositionData, Convert.ToInt32(hdnUserID.Value));
        }

        switch (result)
        {
        case -1:
            lblMessage.Text = Messages.DisplayMessage(MSG03, true);
            break;

        case 0:
            lblMessage.Text = Messages.DisplayMessage(MSG02, true);
            break;

        default:
            lblMessage.Text = Messages.DisplayMessage(MSG01, false);
            break;
        }

        wsEmployeePosition = null;
        return(result);
    }
    /// <summary>
    /// Get Position By Curriculum
    /// </summary>
    /// <returns></returns>
    public List <EmployeePositionData> GetPositionByCurriculum(Int32 CurriculumId)
    {
        List <EmployeePositionData> lstEmployeePositionData = new List <EmployeePositionData>();
        EmployeePositionData        oEmployeePosition       = null;

        param = new List <SqlParameter>();
        param.Add(new SqlParameter("@CurriculumId", CurriculumId));

        SqlDataReader oReader = DBOPS.SqlHelper.ExecuteReader(connectionString, CommandType.StoredProcedure, "GetPositionByCurriculum", param.ToArray());

        if (oReader != null)
        {
            while (oReader.Read())
            {
                oEmployeePosition            = new EmployeePositionData();
                oEmployeePosition.PositionID = Convert.ToInt32(oReader["PositionID"]);

                lstEmployeePositionData.Add(oEmployeePosition);
            }
            oReader.Close();
            oReader = null;
        }

        return(lstEmployeePositionData);
    }
    /// <summary>
    /// Gets the facility master user.
    /// </summary>
    /// <param name="clientId">The client identifier.</param>
    /// <param name="facility">The facility.</param>
    /// <returns></returns>
    public List <EmployeePositionData> GetFacilityMasterUser(int clientId, int facility)
    {
        List <EmployeePositionData> lstEmployees = new List <EmployeePositionData>();
        EmployeePositionData        oEmployee    = null;

        param = new List <SqlParameter>();
        param.Add(new SqlParameter("@fa_key", facility));
        param.Add(new SqlParameter("@userID", clientId));

        SqlDataReader oReader = DBOPS.SqlHelper.ExecuteReader(connectionString, CommandType.StoredProcedure, "GetFacilityMasterUser", param.ToArray());

        if (oReader != null)
        {
            while (oReader.Read())
            {
                oEmployee = new EmployeePositionData();

                oEmployee.EmployeeID      = Convert.ToInt32(oReader["em_key"]);
                oEmployee.Employee        = Convert.ToString(oReader["Employee"]);
                oEmployee.Facility        = Convert.ToInt32(oReader["fa_key"]);
                oEmployee.EmployeeEmailId = Convert.ToString(oReader["cu_email"]);

                lstEmployees.Add(oEmployee);
            }

            oReader.Close();
            oReader = null;
        }

        return(lstEmployees);
    }
    /// <summary>
    /// Gets the positions based on access.
    /// </summary>
    /// <param name="accessType">Type of the access.</param>
    /// <returns></returns>
    public List <EmployeePositionData> GetPositionsBasedOnAccess(int accessType)
    {
        List <EmployeePositionData> lstPositions = new List <EmployeePositionData>();
        EmployeePositionData        oPosition    = null;

        param = new List <SqlParameter>();
        param.Add(new SqlParameter("@accessType", accessType));

        SqlDataReader oReader = DBOPS.SqlHelper.ExecuteReader(connectionString, CommandType.StoredProcedure, "GetPositionsBasedOnAccess", param.ToArray());

        if (oReader != null)
        {
            while (oReader.Read())
            {
                oPosition            = new EmployeePositionData();
                oPosition.PositionID = Convert.ToInt32(oReader["PositionID"]);
                oPosition.Position   = Convert.ToString(oReader["Position"]);
                lstPositions.Add(oPosition);
            }

            oReader.Close();
            oReader = null;
        }

        return(lstPositions);
    }
    /// <summary>
    /// Gets all supervisors.
    /// </summary>
    /// <param name="clientId">The client identifier.</param>
    /// <param name="facility">The facility.</param>
    /// <param name="employee">The employee.</param>
    /// <returns></returns>
    public List <EmployeePositionData> GetAllSupervisors(int clientId, int facility, int employee)
    {
        WsFacility wsfacility          = new WsFacility();
        string     connectionstringweb = wsfacility.GetConnectionString(clientId);

        List <EmployeePositionData> lstEmployees = new List <EmployeePositionData>();
        EmployeePositionData        oSupervisors = null;

        param = new List <SqlParameter>();
        param.Add(new SqlParameter("@fa_key", facility));

        SqlDataReader oReader = DBOPS.SqlHelper.ExecuteReader(connectionstringweb, CommandType.StoredProcedure, "GetSupervisors", param.ToArray());

        if (oReader != null)
        {
            while (oReader.Read())
            {
                oSupervisors = new EmployeePositionData();

                oSupervisors.EmployeeID = Convert.ToInt32(oReader["em_key"]);
                oSupervisors.Employee   = Convert.ToString(oReader["Supervisor"]);
                oSupervisors.IsActive   = Convert.ToBoolean(oReader["em_active"]);

                lstEmployees.Add(oSupervisors);
            }

            oReader.Close();
            oReader = null;
        }

        return(lstEmployees);
    }
    /// <summary>
    /// Gets the positions to publish.
    /// </summary>
    /// <returns></returns>
    public List <EmployeePositionData> GetPositionsToPublish()
    {
        List <EmployeePositionData> lstPositions      = new List <EmployeePositionData>();
        EmployeePositionData        oEmployeePosition = null;

        SqlDataReader oReader = DBOPS.SqlHelper.ExecuteReader(connectionString, CommandType.StoredProcedure, "GetPropagatePosition");

        if (oReader != null)
        {
            while (oReader.Read())
            {
                oEmployeePosition = new EmployeePositionData();

                oEmployeePosition.PositionID       = Convert.ToInt32(oReader["PositionID"]);
                oEmployeePosition.Position         = Convert.ToString(oReader["Position"]);
                oEmployeePosition.ServiceID        = Convert.ToInt32(oReader["ServiceID"]);
                oEmployeePosition.ClassificationID = Convert.ToInt32(oReader["ClassificationID"]);
                oEmployeePosition.IsDistributed    = Convert.ToBoolean(oReader["IsDistribute"]);
                oEmployeePosition.Service          = GetService(oEmployeePosition.ServiceID);
                oEmployeePosition.Classification   = GetClassification(oEmployeePosition.ClassificationID);

                lstPositions.Add(oEmployeePosition);
            }

            oReader.Close();
            oReader = null;
        }

        return(lstPositions);
    }
    /// <summary>
    /// Gets the employee positions.
    /// </summary>
    /// <returns></returns>
    public List <EmployeePositionData> GetEmployeePositions()
    {
        List <EmployeePositionData> lstEmployeePositionData = new List <EmployeePositionData>();
        EmployeePositionData        oEmployeePosition       = null;

        SqlDataReader oReader = DBOPS.SqlHelper.ExecuteReader(connectionString, CommandType.StoredProcedure, "GetPositions");

        if (oReader != null)
        {
            while (oReader.Read())
            {
                oEmployeePosition                       = new EmployeePositionData();
                oEmployeePosition.PositionID            = Convert.ToInt32(oReader["PositionID"]);
                oEmployeePosition.Position              = Convert.ToString(oReader["Position"]);
                oEmployeePosition.Description           = Convert.ToString(oReader["Description"]);
                oEmployeePosition.HouseKeeper           = Convert.ToString(oReader["HouseKeeper"]);
                oEmployeePosition.IsDistributed         = Convert.ToBoolean(oReader["IsDistributed"]);
                oEmployeePosition.ServiceID             = Convert.ToInt32(oReader["Service"]);
                oEmployeePosition.ClassificationID      = Convert.ToInt32(oReader["Classification"]);
                oEmployeePosition.Service               = GetService(oEmployeePosition.ServiceID);
                oEmployeePosition.Classification        = GetClassification(oEmployeePosition.ClassificationID);
                oEmployeePosition.ManagementTraining    = Convert.ToBoolean(oReader["ManagementTraining"]);
                oEmployeePosition.IsAnnualCertification = Convert.ToBoolean(oReader["IsAnnualCertification"]);
                oEmployeePosition.IsAssociatedToUser    = Convert.ToString(oReader["IsAssignedToUser"]);

                lstEmployeePositionData.Add(oEmployeePosition);
            }
            oReader.Close();
            oReader = null;
        }

        return(lstEmployeePositionData);
    }
    /// <summary>
    /// Saves the employee position.
    /// </summary>
    /// <param name="employeePostionData">The employee postion data.</param>
    /// <param name="userID">The user identifier.</param>
    /// <returns></returns>
    public int SaveEmployeePosition(EmployeePositionData employeePostionData, int userID)
    {
        int    result  = 0;
        object oResult = null;

        param = new List <SqlParameter>();
        param.Add(new SqlParameter("@ep_key", employeePostionData.PositionID));
        param.Add(new SqlParameter("@ep_name", employeePostionData.Position));
        param.Add(new SqlParameter("@ep_description", employeePostionData.Description));
        param.Add(new SqlParameter("@ep_hk_key", employeePostionData.HouseKeepingID));
        param.Add(new SqlParameter("@ep_service", employeePostionData.ServiceID));
        param.Add(new SqlParameter("@ep_classification", employeePostionData.ClassificationID));
        param.Add(new SqlParameter("@ep_mgt_training", employeePostionData.ManagementTraining));
        param.Add(new SqlParameter("@ep_is_annual_cert", employeePostionData.IsAnnualCertification));
        param.Add(new SqlParameter("@LastUserID", userID));

        oResult = DBOPS.SqlHelper.ExecuteScalar(connectionString, CommandType.StoredProcedure, "SaveEmployeePosition", param.ToArray());

        if (oResult != null && Convert.ToString(oResult) != string.Empty)
        {
            result = Convert.ToInt32(oResult);
        }

        return(result);
    }
    /// <summary>
    /// Gets the employee position.
    /// </summary>
    /// <param name="positionID">The position identifier.</param>
    /// <returns></returns>
    public EmployeePositionData GetEmployeePosition(int positionID)
    {
        EmployeePositionData oEmployeePositionData = null;

        param = new List <SqlParameter>();
        param.Add(new SqlParameter("@PositionID", positionID));

        SqlDataReader oReader = DBOPS.SqlHelper.ExecuteReader(connectionString, CommandType.StoredProcedure, "GetEmployeePostionByID", param.ToArray());

        if (oReader != null)
        {
            while (oReader.Read())
            {
                oEmployeePositionData                       = new EmployeePositionData();
                oEmployeePositionData.PositionID            = Convert.ToInt32(oReader["PositionID"]);
                oEmployeePositionData.Position              = Convert.ToString(oReader["Position"]);
                oEmployeePositionData.Description           = Convert.ToString(oReader["Description"]);
                oEmployeePositionData.HouseKeepingID        = Convert.ToInt32(oReader["HouseKeeperID"]);
                oEmployeePositionData.HouseKeeper           = Convert.ToString(oReader["HouseKeeper"]);
                oEmployeePositionData.IsDistributed         = Convert.ToBoolean(oReader["IsDistributed"]);
                oEmployeePositionData.ServiceID             = Convert.ToInt32(oReader["Service"]);
                oEmployeePositionData.ClassificationID      = Convert.ToInt32(oReader["Classification"]);
                oEmployeePositionData.ManagementTraining    = Convert.ToBoolean(oReader["ManagementTraining"]);
                oEmployeePositionData.IsAnnualCertification = Convert.ToBoolean(oReader["IsAnnualCertification"]);
            }

            oReader.Close();
            oReader = null;
        }

        return(oEmployeePositionData);
    }
Exemple #11
0
    /// <summary>
    /// Reads the page data and return the EmployeePosition Data object.
    /// </summary>
    /// <returns></returns>
    private EmployeePositionData ReadEmployeePositionData()
    {
        EmployeePositionData oEmployeePositionData = new EmployeePositionData();

        oEmployeePositionData.PositionID            = Convert.ToInt32(hdnEmpPositionID.Value);
        oEmployeePositionData.Position              = txtPosition.Text.Trim();
        oEmployeePositionData.Description           = txtDescription.Text.Trim();
        oEmployeePositionData.HouseKeepingID        = Convert.ToInt32(ddlHouseKeeping.SelectedValue);
        oEmployeePositionData.ServiceID             = Convert.ToInt32(ddlService.SelectedValue);
        oEmployeePositionData.ClassificationID      = Convert.ToInt32(ddlClassification.SelectedValue);
        oEmployeePositionData.ManagementTraining    = chkMgtTraining.Checked;
        oEmployeePositionData.IsAnnualCertification = chkAnnualCertification.Checked;

        return(oEmployeePositionData);
    }
Exemple #12
0
    /// <summary>
    /// Loads the Employee Position and grid with records.
    /// </summary>
    private void LoadEmployeePosition()
    {
        wsEmployeePosition = new WsEmployeePosition();
        EmployeePositionData oEmployeePositionData = wsEmployeePosition.GetEmployeePosition(Convert.ToInt32(hdnEmpPositionID.Value));

        if (oEmployeePositionData != null)
        {
            hdnLastEmpPositionID.Value      = hdnEmpPositionID.Value;
            txtPosition.Text                = oEmployeePositionData.Position;
            txtDescription.Text             = oEmployeePositionData.Description;
            ddlHouseKeeping.SelectedValue   = Convert.ToString(oEmployeePositionData.HouseKeepingID);
            ddlService.SelectedValue        = Convert.ToString(oEmployeePositionData.ServiceID);
            ddlClassification.SelectedValue = Convert.ToString(oEmployeePositionData.ClassificationID);
            chkMgtTraining.Checked          = Convert.ToBoolean(oEmployeePositionData.ManagementTraining);
            chkAnnualCertification.Checked  = Convert.ToBoolean(oEmployeePositionData.IsAnnualCertification);

            txtPosition.Enabled  = oEmployeePositionData.IsDistributed ? false : true;
            hdnIsPublished.Value = Convert.ToString(oEmployeePositionData.IsDistributed);
        }

        wsEmployeePosition = null;
    }
Exemple #13
0
 public int SaveEmployeePostion(EmployeePositionData oEmpPosition, int userID)
 {
     return(oEmployeePosition.SaveEmployeePosition(oEmpPosition, userID));
 }