private void LoadGeneralManager() { try { PMS_GETEMPLOYEE _obj_Pms_GetEmployee = new PMS_GETEMPLOYEE(); _obj_Pms_GetEmployee.Mode = 3; DataTable DT_Details = new DataTable(); if (rcmb_EmployeeType.SelectedItem.Value != "") { _obj_Pms_GetEmployee.BU_ID = Convert.ToInt32(rcmb_BusinessUnitType.SelectedItem.Value); _obj_Pms_GetEmployee.EMP_ID = Convert.ToInt32(rcmb_EmployeeType.SelectedItem.Value); _obj_Pms_GetEmployee.REPORTINGMGR_ID = Convert.ToInt32(rcmb_ReportingMgrType.SelectedItem.Value); DT_Details = Pms_Bll.get_Employee(_obj_Pms_GetEmployee); if (DT_Details.Rows.Count != 0) { BindGeneralManager(DT_Details); } else { BindGeneralManager(DT_Details); } } else { BindGeneralManager(DT_Details); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Pms_EmpSetup", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadEmployees() { try { _obj_PMS_getemployee = new PMS_GETEMPLOYEE(); _obj_PMS_getemployee.Mode = 1; _obj_PMS_getemployee.EMP_ID = Convert.ToInt32(Session["EMP_ID"]); _obj_PMS_getemployee.LASTMDFBY = Convert.ToInt32(Session["ORG_ID"]); DataTable dt = Pms_Bll.get_RMEmployees(_obj_PMS_getemployee); rcmb_Employee.Items.Clear(); rcmb_Employee.DataSource = dt; rcmb_Employee.DataTextField = "employee"; rcmb_Employee.DataValueField = "EMPID"; rcmb_Employee.DataBind(); rcmb_Employee.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); rcmb_Employee.SelectedIndex = 0; } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "EmployeesLeaveCalendar", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
/// <summary> /// Here Edit a Particular Record.. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lnk_Edit_Commnad(object sender, CommandEventArgs e) { try { clearfields(); _obj_idp = new pms_IDPSCREEN(); _obj_idp.IDP_MODE = 2; _obj_idp.IDP_ID = Convert.ToInt32(e.CommandArgument); DataTable DT = Pms_Bll.get_idp(_obj_idp); if (DT.Rows.Count != 0) { lbl_id.Text = Convert.ToString(DT.Rows[0]["IDP_ID"]); Session["empid1"] = (DT.Rows[0]["IDP_EMP_ID"]); _obj_idp = new pms_IDPSCREEN(); _obj_idp.IDP_MODE = 6; _obj_idp.IDP_EMP_ID = Convert.ToInt32(Convert.ToString(DT.Rows[0]["IDP_EMP_ID"])); _obj_idp.IDP_ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt_Bus = Pms_Bll.get_idp(_obj_idp); loadBusinessUnit(); if (dt_Bus.Rows.Count != 0) { RCB_BusinessUnit.SelectedIndex = RCB_BusinessUnit.Items.FindItemIndexByValue(Convert.ToString(dt_Bus.Rows[0]["EMP_BUSINESSUNIT_ID"])); } //LoadEmployees(); _obj_Pms_EmpSetup = new PMS_EMPSETUP(); _obj_PMS_getemployee = new PMS_GETEMPLOYEE(); if ((Convert.ToString(Session["EMP_TYPE"])) == "5") { _obj_PMS_getemployee.EMP_ID = Convert.ToInt32(Session["EMP_ID"]); } else { _obj_PMS_getemployee.EMP_ID = Convert.ToInt32(Session["EMP_ID"]); } _obj_PMS_getemployee.LASTMDFBY = Convert.ToInt32(Session["ORG_ID"]); _obj_PMS_getemployee.BU_ID = Convert.ToInt32(RCB_BusinessUnit.SelectedItem.Value); _obj_PMS_getemployee.Mode = 5; DataTable dtbuid = Pms_Bll.get_RMEmployees(_obj_PMS_getemployee); if (dtbuid.Rows.Count != 0) { RCB_EmployeeName.DataSource = dtbuid; RCB_EmployeeName.DataTextField = "employee"; RCB_EmployeeName.DataValueField = "EMPID"; RCB_EmployeeName.DataBind(); RCB_EmployeeName.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); //RCB_BusinessUnit.Visible = false; //lbl_BusinessUnit.Visible = false; } else { DataTable dt1 = new DataTable(); RCB_EmployeeName.DataSource = dt1; RCB_EmployeeName.DataBind(); //lbl_BusinessUnit.Visible = false; //RCB_BusinessUnit.Visible = false; } RCB_EmployeeName.SelectedIndex = RCB_EmployeeName.Items.FindItemIndexByValue(Convert.ToString(DT.Rows[0]["IDP_EMP_ID"])); //LoadAppraisalCycle1(); //rcm_apprcycle.SelectedIndex = rcm_apprcycle.Items.FindItemIndexByValue(Convert.ToString(DT.Rows[0]["IDP_APPRAISALCYCLE"])); txt_IDP.Text = Pms_Bll.ReplaceQuote(Convert.ToString(DT.Rows[0]["IDP_NAME"])); txt_Description.Text = Pms_Bll.ReplaceQuote(Convert.ToString(DT.Rows[0]["IDP_DESCRIPTION"])); RDP_StartDate.SelectedDate = Convert.ToDateTime(DT.Rows[0]["IDP_STARTDATE"]); //RDP_EndDate.SelectedDate = Convert.ToDateTime(DT.Rows[0]["IDP_ENDDATE"]); txt_Comments.Text = Convert.ToString(DT.Rows[0]["IDP_COMMENTS"]); if (DT.Rows[0]["IDP_STATUS"] != System.DBNull.Value) { if (Convert.ToString(DT.Rows[0]["IDP_STATUS"]).Trim() == "Active") { rcmb_status.SelectedValue = "1"; } else { rcmb_status.SelectedValue = "0"; } } else { rcmb_status.SelectedValue = "0"; } RM_Idpform.SelectedIndex = 1; RP_Idpform.Visible = false; RP_Idpform2.Visible = true; btn_SAVE.Visible = false; btn_UPDATE.Visible = true; RCB_BusinessUnit.Enabled = false; RCB_EmployeeName.Enabled = false; txt_IDP.Enabled = false; //lbl_BusinessUnit.Visible = false; //RCB_BusinessUnit.Visible = false; txt_Comments.Enabled = true; RDP_StartDate.Enabled = false; //RDP_EndDate.Enabled = true; //rcm_apprcycle.Enabled = false; if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2) { btn_UPDATE.Visible = false; } else { btn_UPDATE.Visible = true; if (rcmb_status.SelectedValue == "0") { BLL.ShowMessage(this, "IDP is Inactive.You can not Update the record."); btn_UPDATE.Visible = false; } } } else { } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_idp", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
/// <summary> /// Here RCB_BusinessUnit_SelectedIndexChanged for Getting Business Unit From SMHR... /// </summary> /// <param name="o"></param> /// <param name="e"></param> protected void RCB_BusinessUnit_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e) { try { //LoadEmployees(); if (RCB_BusinessUnit.SelectedIndex > 0) { _obj_Pms_EmpSetup = new PMS_EMPSETUP(); _obj_PMS_getemployee = new PMS_GETEMPLOYEE(); if ((Convert.ToString(Session["EMP_TYPE"])) == "5") { _obj_PMS_getemployee.EMP_ID = Convert.ToInt32(Session["EMP_ID"]); } else { _obj_PMS_getemployee.EMP_ID = Convert.ToInt32(Session["EMP_ID"]); } _obj_PMS_getemployee.BU_ID = Convert.ToInt32(RCB_BusinessUnit.SelectedItem.Value); _obj_PMS_getemployee.LASTMDFBY = Convert.ToInt32(Session["ORG_ID"]); _obj_PMS_getemployee.Mode = 4; DataTable dtbuid = Pms_Bll.get_RMEmployees(_obj_PMS_getemployee); if (dtbuid.Rows.Count != 0) { RCB_EmployeeName.DataSource = dtbuid; RCB_EmployeeName.DataTextField = "employee"; RCB_EmployeeName.DataValueField = "EMPID"; RCB_EmployeeName.DataBind(); RCB_EmployeeName.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); //RCB_BusinessUnit.Visible = false; //lbl_BusinessUnit.Visible = false; } else { DataTable dt1 = new DataTable(); RCB_EmployeeName.DataSource = dt1; RCB_EmployeeName.DataBind(); //lbl_BusinessUnit.Visible = false; //RCB_BusinessUnit.Visible = false; } //LoadAppraisalCycle(); } else { RCB_EmployeeName.ClearSelection(); RCB_EmployeeName.Items.Clear(); RCB_EmployeeName.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); //rcm_apprcycle.ClearSelection(); //rcm_apprcycle.Items.Clear(); //rcm_apprcycle.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_idp", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
public void sendMail(int EMP_ID, string STR) { try { _obj_PMS_getemployee = new PMS_GETEMPLOYEE(); _obj_PMS_getemployee.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_PMS_getemployee.EMP_ID = Convert.ToInt32(EMP_ID); _obj_PMS_getemployee.Mode = 6; DataTable dt = Pms_Bll.get_RMEmployees(_obj_PMS_getemployee); if (dt.Rows.Count != 0) { if (dt.Rows[0]["APPMGR_EMAIL"] != System.DBNull.Value && dt.Rows[0]["APPMGR_EMAIL"] != string.Empty && dt.Rows[0]["RPTMGR_EMAIL"] != System.DBNull.Value && dt.Rows[0]["RPTMGR_EMAIL"] != string.Empty) { //MailMessage msgMail = new MailMessage(); //string From = string.Empty; //string To = string.Empty; //string Body = string.Empty; //msgMail.From = new MailAddress("*****@*****.**", "Smart HR"); ////msgMail.To.Add(Convert.ToString("*****@*****.**")); string toAddress, subject, body, ccAddress; ccAddress = (Convert.ToString(dt.Rows[0]["APPMGR_EMAIL"])); toAddress = (Convert.ToString(dt.Rows[0]["RPTMGR_EMAIL"])); if (STR.Trim() == "Approved") { if (dt.Rows[0]["EMP_EMAIL"] != System.DBNull.Value && dt.Rows[0]["EMP_EMAIL"] != string.Empty) { toAddress = (Convert.ToString(dt.Rows[0]["EMP_EMAIL"])); } else { return; } } subject = "Goal Setting"; body = "<html>" + "<body> " + "<p>Dear, " + Convert.ToString(dt.Rows[0]["RPTMGR_NAME"]) + " </p> " + "<p>Goal Setting is " + STR + " for " + Convert.ToString(dt.Rows[0]["EMP_NAME"]) + " for Appraisal Cycle - " + Convert.ToString(rtxt_AppraisalCycle.SelectedItem.Text) + ". <br>" + "</p> " + "<p>Best Regards,<br/><br/>" + "Team Smart HR</p>" + "</body>" + " </html>"; BLL.SendMail(toAddress, ccAddress, subject, body); //BLL.ShowMessage(this, "A Mail has been sent to the Reviewer."); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Test", "<script type='text/javascript'>Close()</" + "script>", false); } } //else //{ // BLL.ShowMessage(this, "Security Code is Invalid"); // return; //} } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_GsApproval", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
/// <summary> ///IN THIS BASED ON Task_ID(COMMANDARGUMENT) ALL DATA WILL BE TAKEN TO DATATABLE THEN WE CAN BIND TO INDIVIDUAL FIELDS /// </summary> /// <param name="source"></param> /// <param name="e"></param> protected void lnk_edit_command(object sender, CommandEventArgs e) { try { clearControls(); btn_Save.Text = "Update"; LoadBusinessUnit(); //LoadGoal(); rcmb_BusinessUnitType.SelectedIndex = -1; _obj_Pms_Task = new SPMS_TASK(); _obj_Pms_Task.Mode = 2; _obj_Pms_Task.TASK_ID = Convert.ToInt32(Convert.ToString(e.CommandArgument)); DataTable DT = Pms_Bll.get_Task(_obj_Pms_Task); if (DT.Rows.Count != 0) { lbl_Task_Id.Text = Convert.ToString(DT.Rows[0]["TASK_ID"]); Session["empid1"] = (DT.Rows[0]["EMP_ID"]); _obj_Pms_Task = new SPMS_TASK(); _obj_Pms_Task.Mode = 6; _obj_Pms_Task.TASK_ORG_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Pms_Task.TASK_EMP_ID = Convert.ToInt32(Convert.ToString(DT.Rows[0]["EMP_ID"])); DataTable dt_Bus = Pms_Bll.get_Task(_obj_Pms_Task); LoadBusinessUnit(); rcmb_BusinessUnitType.SelectedIndex = rcmb_BusinessUnitType.FindItemIndexByValue(Convert.ToString(dt_Bus.Rows[0]["EMP_BUSINESSUNIT_ID"])); //LoadEmployees(); PMS_EMPSETUP _obj_Pms_EmpSetup; _obj_Pms_EmpSetup = new PMS_EMPSETUP(); _obj_PMS_getemployee = new PMS_GETEMPLOYEE(); if ((Convert.ToString(Session["EMP_TYPE"])) == "5") { _obj_PMS_getemployee.EMP_ID = Convert.ToInt32(Session["EMP_ID"]); } else { _obj_PMS_getemployee.EMP_ID = Convert.ToInt32(Session["EMP_ID"]); } _obj_PMS_getemployee.BU_ID = Convert.ToInt32(rcmb_BusinessUnitType.SelectedItem.Value); _obj_PMS_getemployee.LASTMDFBY = Convert.ToInt32(Session["ORG_ID"]); _obj_PMS_getemployee.Mode = 5; dtbuid = Pms_Bll.get_RMEmployees(_obj_PMS_getemployee); if (dtbuid.Rows.Count != 0) { rcmb_EmployeeType.Items.Clear(); rcmb_EmployeeType.DataSource = dtbuid; rcmb_EmployeeType.DataTextField = "employee"; rcmb_EmployeeType.DataValueField = "EMPID"; rcmb_EmployeeType.DataBind(); rcmb_EmployeeType.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); //rcmb_BusinessUnitType.Visible = false; //lbl_BusinessUnitName.Visible = false; } else { DataTable dt1 = new DataTable(); rcmb_EmployeeType.DataSource = dt1; rcmb_EmployeeType.DataBind(); //lbl_BusinessUnitName.Visible = false; //rcmb_BusinessUnitType.Visible = false; } //EmpLoad(); rcmb_EmployeeType.SelectedIndex = rcmb_EmployeeType.Items.FindItemIndexByValue(Convert.ToString(DT.Rows[0]["EMP_ID"])); //rcmb_EmployeeType.SelectedValue = Convert.ToString(DT.Rows[0]["TASK_EMP_ID"]); rtxt_TaskName.Text = Convert.ToString(DT.Rows[0]["TASK_NAME"]); rtxt_TaskDescription.Text = Convert.ToString(DT.Rows[0]["TASK_DESCRIPTION"]); rdtp_DATE.SelectedDate = Convert.ToDateTime(DT.Rows[0]["TASK_DATE"]); LoadGoal1(); rcmb_GoalType.SelectedIndex = rcmb_GoalType.Items.FindItemIndexByValue(Convert.ToString(DT.Rows[0]["TASK_GOAL"])); LoadAppraisalCycle1(); rcm_apprcycle.SelectedIndex = rcm_apprcycle.Items.FindItemIndexByValue(Convert.ToString(DT.Rows[0]["TASK_APPRAISAL_CYCLE"])); btn_Save.Visible = true; rtxt_TaskName.Enabled = false; Rm_TASK_PAGE.SelectedIndex = 1; Rp_TASK_VIEWMAIN.Visible = false; Rp_TASK_VIEWDETAILS.Visible = true; rcmb_BusinessUnitType.Enabled = false; rcmb_EmployeeType.Enabled = false; //rcmb_BusinessUnitType.Visible = false; //lbl_BusinessUnitName.Visible = false; rcmb_GoalType.Enabled = false; rcm_apprcycle.Enabled = false; rdtp_DATE.Enabled = false; if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2) { btn_Save.Visible = false; } else { btn_Save.Visible = true; } } else { Pms_Bll.ShowMessage(this, "Error Occured"); } } catch (Exception ex) { //Pms_Bll.ShowMessage(this, ex.Message.ToString()); //return; SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PmsTask", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
/// <summary> /// HERE I AM LOADING EMPLOYEE DETAILS WHEN BUSINESS UNIT COMBO BOX SELECT INDEX CHANGED EVENT FIRED /// </summary> /// <param name="o"></param> /// <param name="e"></param> protected void rcmb_BusinessUnitType_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e) { try { if (rcmb_BusinessUnitType.SelectedIndex > 0) { PMS_EMPSETUP _obj_Pms_EmpSetup; _obj_Pms_EmpSetup = new PMS_EMPSETUP(); _obj_PMS_getemployee = new PMS_GETEMPLOYEE(); _obj_PMS_getemployee.EMP_ID = Convert.ToInt32(Session["EMP_ID"]); _obj_PMS_getemployee.BU_ID = Convert.ToInt32(rcmb_BusinessUnitType.SelectedItem.Value); _obj_PMS_getemployee.Mode = 4; _obj_PMS_getemployee.LASTMDFBY = Convert.ToInt32(Session["ORG_ID"]); dtbuid = Pms_Bll.get_RMEmployees(_obj_PMS_getemployee); if (dtbuid.Rows.Count != 0) { rcmb_EmployeeType.Items.Clear(); rcmb_EmployeeType.DataSource = dtbuid; rcmb_EmployeeType.DataTextField = "employee"; rcmb_EmployeeType.DataValueField = "EMPID"; rcmb_EmployeeType.DataBind(); rcmb_EmployeeType.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); //rcmb_BusinessUnitType.Visible = false; //lbl_BusinessUnitName.Visible = false; } else { DataTable dt1 = new DataTable(); rcmb_EmployeeType.DataSource = dt1; rcmb_EmployeeType.DataBind(); //lbl_BusinessUnitName.Visible = false; //rcmb_BusinessUnitType.Visible = false; } rcmb_EmployeeType.SelectedIndex = 0; //lbl_BusinessUnitName.Visible = false; //rcmb_BusinessUnitType.Visible = false; rcm_apprcycle.Enabled = true; DataTable dt2 = new DataTable(); rcmb_GoalType.DataSource = dt2; rcmb_GoalType.DataBind(); LoadAppraisalCycle(); } else { rcmb_EmployeeType.ClearSelection(); rcmb_EmployeeType.Items.Clear(); rcmb_EmployeeType.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); rcm_apprcycle.ClearSelection(); rcm_apprcycle.Items.Clear(); rcm_apprcycle.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); rcmb_GoalType.ClearSelection(); rcmb_GoalType.Items.Clear(); rcmb_GoalType.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); } } catch (Exception ex) { //Pms_Bll.ShowMessage(this, ex.Message.ToString()); //return; SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PmsTask", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void lnk_Add_Command(object sender, CommandEventArgs e) { try { clearControls(); btn_Save.Visible = true; btn_cancel.Visible = true; btn_Save.Text = "Save"; btn_cancel.Text = "Cancel"; rtxt_TaskName.Enabled = true; LoadBusinessUnit(); rcmb_EmployeeType.Enabled = true; rcmb_BusinessUnitType.Enabled = true; rcmb_BusinessUnitType.SelectedIndex = -1; LoadGoal(); Rm_TASK_PAGE.SelectedIndex = 1; lbl_BusinessUnitName.Visible = false; rcmb_BusinessUnitType.Visible = false; rcmb_EmployeeType.SelectedIndex = Convert.ToInt32(Session["empid"]); PMS_EMPSETUP _obj_Pms_EmpSetup; _obj_Pms_EmpSetup = new PMS_EMPSETUP(); _obj_PMS_getemployee = new PMS_GETEMPLOYEE(); if ((Convert.ToString(Session["EMP_TYPE"])) == "13") { _obj_PMS_getemployee.EMP_ID = Convert.ToInt32(Session["EMP_ID"]); } DataTable dtbuid = Pms_Bll.get_GMEmployees(_obj_PMS_getemployee); if (dtbuid.Rows.Count != 0) { rcmb_EmployeeType.Items.Clear(); rcmb_EmployeeType.DataSource = dtbuid; rcmb_EmployeeType.DataTextField = "employee"; rcmb_EmployeeType.DataValueField = "EMPID"; rcmb_EmployeeType.DataBind(); rcmb_EmployeeType.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); rcmb_BusinessUnitType.Visible = false; lbl_BusinessUnitName.Visible = false; } else { DataTable dt1 = new DataTable(); rcmb_EmployeeType.DataSource = dt1; rcmb_EmployeeType.DataBind(); lbl_BusinessUnitName.Visible = false; rcmb_BusinessUnitType.Visible = false; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Pms_Task", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }