/// <summary> /// Copy New Curriculum /// </summary> private void CopyNewPosition() { wsEmployeePosition = new WsEmployeePosition(); int result = 0; result = wsEmployeePosition.CopyEmployeePosition(Convert.ToInt32(hdnEmpPositionID.Value), Convert.ToString(txtPosition.Text.Trim() + "_Copy"), Convert.ToInt32(hdnUserID.Value)); if (result > 0) { hdnEmpPositionID.Value = Convert.ToString(result); hdnCurrentKey.Value = "0"; LoadHouseKeeping(); LoadEmployeePosition(); LoadGrid(false); LoadNavigation(); } switch (result) { case -1: lblMessage.Text = Messages.DisplayMessage(MSG06, true); break; case 0: lblMessage.Text = Messages.DisplayMessage(MSG05, true); break; default: lblMessage.Text = Messages.DisplayMessage(MSG04, false); break; } wsEmployeePosition = null; }
/// <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> /// Grid Curriculum Detail table /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void grdCurriculum_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { GridDataItem dataitem = (GridDataItem)e.DetailTableView.ParentItem; int tcKey = Convert.ToInt32(dataitem.GetDataKeyValue("tcc_key").ToString()); wsEmployeePosition = new WsEmployeePosition(); dsTraining = wsEmployeePosition.GetTrainingByCurriculum(tcKey); wsEmployeePosition = null; e.DetailTableView.DataSource = dsTraining; }
/// <summary> /// Loads the house keeping data into Dropdown. /// </summary> private void LoadHouseKeeping() { wsEmployeePosition = new WsEmployeePosition(); lstHouseKeeping = wsEmployeePosition.GetHouseKeeping(); ddlHouseKeeping.DataSource = lstHouseKeeping; ddlHouseKeeping.DataTextField = "Description"; ddlHouseKeeping.DataValueField = "HouseKeepID"; ddlHouseKeeping.DataBind(); wsEmployeePosition = null; }
/// <summary> /// Gets the list of EmployeePostion for edit mode, and loads the current position. /// </summary> private void LoadNavigation() { wsEmployeePosition = new WsEmployeePosition(); htEmployeePostion = wsEmployeePosition.GetEmployeePositionID(); wsEmployeePosition = null; if (Convert.ToInt32(hdnCurrentKey.Value) == 0) { hdnCurrentKey.Value = Hash.GetHashKey(htEmployeePostion, Convert.ToInt32(hdnEmpPositionID.Value)).ToString(); } EnableDisableNavigation(Convert.ToInt32(hdnCurrentKey.Value)); }
/// <summary> /// Save Curriculum /// </summary> /// <param name="PositionID"></param> private void SaveCurriculum(int PositionID) { wsEmployeePosition = new WsEmployeePosition(); string curriculumIds = string.Empty; foreach (GridDataItem item in grdCurriculum.MasterTableView.Items) { string CurriculumID = Convert.ToString(item.GetDataKeyValue("tcc_key").ToString()); bool chkIsSelected = ((CheckBox)item.FindControl("chkIsSelected")).Checked; if (chkIsSelected && !string.IsNullOrEmpty(CurriculumID)) { curriculumIds = !string.IsNullOrEmpty(curriculumIds) ? string.Concat(curriculumIds, CurriculumID, ",") : string.Concat(CurriculumID, ","); } } int result = wsEmployeePosition.SaveCurriculum(PositionID, curriculumIds); }
/// <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; }
/// <summary> /// Load Curriculum By Position /// </summary> private void LoadCurriculumByPosition() { wsEmployeePosition = new WsEmployeePosition(); dsCurriculum = wsEmployeePosition.GetCurriculumByPosition(Convert.ToInt32(hdnEmpPositionID.Value)); wsEmployeePosition = null; }