private void LoadQualification() { try { _obj_smhr_employee = new SMHR_EMPLOYEE(); _obj_smhr_employee.EMP_ID = Convert.ToInt32(Request.QueryString["ID"]); _obj_smhr_employee.Mode = 1; DataTable dt1 = BLL.get_EmpESS(_obj_smhr_employee); if (dt1.Rows.Count != 0) { _lbl_Emp_Id = Convert.ToString(dt1.Rows[0]["EMP_APPLICANT_ID"]); } _obj_smhr_applicant = new SMHR_APPLICANT(); _obj_smhr_applicant.APPQFN_APPLICANT_ID = Convert.ToInt32(_lbl_Emp_Id); _obj_smhr_applicant.OPERATION = operation.Check; DataTable dt = BLL.get_ApplicantQualification(_obj_smhr_applicant); RG_Qualification.DataSource = dt; RG_Qualification.DataBind(); } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Qualification", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void btn_Qual_Correct_Click(object sender, EventArgs e) { try { _obj_smhr_employee = new SMHR_EMPLOYEE(); _obj_smhr_employee.EMP_ID = Convert.ToInt32(Request.QueryString["ID"]); _obj_smhr_employee.Mode = 1; DataTable dt1 = BLL.get_EmpESS(_obj_smhr_employee); if (dt1.Rows.Count != 0) { _lbl_Emp_Id = Convert.ToString(dt1.Rows[0]["EMP_APPLICANT_ID"]); } _obj_smhr_applicant = new SMHR_APPLICANT(); bool status = false; _obj_smhr_applicant.APPLICANT_ID = Convert.ToInt32(_lbl_Emp_Id); _obj_smhr_applicant.APPQFN_ID = Convert.ToInt32(_lbl_ID); _obj_smhr_applicant.APPQFN_QUALIFICATION_ID = Convert.ToInt32(ddl_Category.SelectedValue); _obj_smhr_applicant.APPQFN_INSTITUTE = Convert.ToString(txt_Institute.Text.Replace("'", "''")); _obj_smhr_applicant.APPQFN_PASSEDYEAR = Convert.ToInt32(txt_YearofPass.Value); _obj_smhr_applicant.APPQFN_PERCENTAGE = Convert.ToDouble(Convert.ToString(txt_Percentage.Value)); _obj_smhr_applicant.APPQFN_GRADE = Convert.ToString(ddl__Grade.SelectedItem.Value); _obj_smhr_applicant.APPQFN_LASTMDFBY = Convert.ToInt32(Session["USER_ID"]); _obj_smhr_applicant.APPQFN_LASTMDFDATE = DateTime.Now; _obj_smhr_applicant.OPERATION = operation.Update; status = BLL.set_AppQualification(_obj_smhr_applicant); LoadQualification(); clearQualFields(); ddl_Category.Enabled = true; } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Qualification", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void btn_Update_Click(object sender, EventArgs e) { try { _obj_smhr_applicant = new SMHR_APPLICANT(); _obj_smhr_applicant.APPLICANT_ADDRESS = Convert.ToString(txt_Address.Text); _obj_smhr_applicant.APPLICANT_ID = Convert.ToInt32(_lbl_Emp_Id); bool status = BLL.set_empSelfservicePersonal(_obj_smhr_applicant); if (status == true) { BLL.ShowMessage(this, "Employee Details Updated"); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Test", "<script type='text/javascript'>Close()</" + "script>", false); return; } else { BLL.ShowMessage(this, "An Error Occured while doing the process"); return; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Personal", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void btn_Skill_Correct_Click(object sender, EventArgs e) { try { _obj_smhr_employee = new SMHR_EMPLOYEE(); _obj_smhr_employee.EMP_ID = Convert.ToInt32(Request.QueryString["ID"]); _obj_smhr_employee.Mode = 1; DataTable dt = BLL.get_EmpESS(_obj_smhr_employee); if (dt.Rows.Count != 0) { _lbl_Emp_Id = Convert.ToString(dt.Rows[0]["EMP_APPLICANT_ID"]); } _obj_smhr_applicant = new SMHR_APPLICANT(); bool status = false; _obj_smhr_applicant.OPERATION = operation.Update; _obj_smhr_applicant.APPSKL_ID = Convert.ToInt32(_lbl_ID); _obj_smhr_applicant.APPLICANT_ID = Convert.ToInt32(_lbl_Emp_Id); _obj_smhr_applicant.APPSKL_SKILL_ID = Convert.ToInt32(rcb_Skill.SelectedItem.Value); _obj_smhr_applicant.APPSKL_LASTUSED = Convert.ToInt32(rcb_YearLastUsed.SelectedItem.Text); _obj_smhr_applicant.APPSKL_EXPERT = Convert.ToInt32(rcb_ExpertLevel.SelectedValue); _obj_smhr_applicant.APPSKL_LASTMDFBY = Convert.ToInt32(Session["USER_ID"]); _obj_smhr_applicant.APPSKL_LASTMDFDATE = DateTime.Now; status = BLL.set_ApplicantSkills(_obj_smhr_applicant); LoadSkill(); clearSkillFields(); } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Skills", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadSkill() { try { getEmployee(); _obj_smhr_applicant = new SMHR_APPLICANT(); int I_ = Convert.ToInt32(ViewState["ddlIndex"]); if (I_ != 0) { _obj_smhr_applicant.APPSKL_APPLICANT_ID = Convert.ToInt32(I_); } else { _obj_smhr_applicant.APPSKL_APPLICANT_ID = Convert.ToInt32(ViewState["APP_ID"]);// Convert.ToInt32(HF_APID.Value); //Convert.ToInt32(_lbl_App_ID); } _obj_smhr_applicant.OPERATION = operation.Check; DataTable dt = BLL.get_ApplicantSkills(_obj_smhr_applicant); RG_Skills.DataSource = dt; ViewState["dt_Skill"] = dt; RG_Skills.DataBind(); } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frmEmpSkills", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void saveSkill() { try { getEmployee(); _obj_smhr_applicant = new SMHR_APPLICANT(); _obj_smhr_applicant.OPERATION = operation.Update; _obj_smhr_applicant.APPLICANT_ID = Convert.ToInt32(ViewState["APP_ID"]);// Convert.ToInt32(HF_APID.Value); //Convert.ToInt32(_lbl_App_ID); bool status = false; foreach (GridItem row in RG_Skills.Items) { _obj_smhr_applicant.OPERATION = operation.Update; _obj_smhr_applicant.APPLICANT_ID = Convert.ToInt32(ViewState["APP_ID"]); //Convert.ToInt32(HF_APID.Value); //Convert.ToInt32(_lbl_App_ID); _obj_smhr_applicant.APPSKL_APPLICANT_ID = Convert.ToInt32(ViewState["APP_ID"]); //Convert.ToInt32(HF_APID.Value); _obj_smhr_applicant.APPSKL_SKILL_ID = Convert.ToInt32((row.FindControl("lbl_Skill_ID") as Label).Text); _obj_smhr_applicant.OPERATION = operation.Check_New; if ((BLL.get_ApplicantSkills(_obj_smhr_applicant)).Rows.Count > 0) { _obj_smhr_applicant.APPSKL_ID = Convert.ToInt32(((DataTable)BLL.get_ApplicantSkills(_obj_smhr_applicant)).Rows[0]["APPSKL_ID"]); //_obj_smhr_applicant.APPSKL_ID = Convert.ToInt32((row.FindControl("lblID") as Label).Text); _obj_smhr_applicant.OPERATION = operation.Update; } else { _obj_smhr_applicant.OPERATION = operation.Insert; } _obj_smhr_applicant.APPSKL_LASTUSED = Convert.ToInt32((row.FindControl("lbl_Skill_LastUsed") as Label).Text); _obj_smhr_applicant.APPSKL_EXPERT = Convert.ToInt32((row.FindControl("lbl_Skill_Exp_ID") as Label).Text); _obj_smhr_applicant.APPSKL_CREATEDBY = Convert.ToInt32(Session["USER_ID"]); _obj_smhr_applicant.APPSKL_CREATEDDATE = DateTime.Now; _obj_smhr_applicant.APPSKL_LASTMDFBY = Convert.ToInt32(Session["USER_ID"]); _obj_smhr_applicant.APPSKL_LASTMDFDATE = DateTime.Now; status = BLL.set_ApplicantSkills(_obj_smhr_applicant); if (status == true) { BLL.ShowMessage(this, "Information Saved Successfully"); return; } } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Skills", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadExperience() { _obj_smhr_employee = new SMHR_EMPLOYEE(); _obj_smhr_employee.EMP_ID = Convert.ToInt32(Request.QueryString["ID"]); _obj_smhr_employee.Mode = 1; DataTable dt1 = BLL.get_EmpESS(_obj_smhr_employee); if (dt1.Rows.Count != 0) { _lbl_Emp_Id = Convert.ToString(dt1.Rows[0]["EMP_APPLICANT_ID"]); } _obj_smhr_applicant = new SMHR_APPLICANT(); _obj_smhr_applicant.APPEXP_APPLICANT_ID = Convert.ToInt32(_lbl_Emp_Id); _obj_smhr_applicant.OPERATION = operation.Check; DataTable dt = BLL.get_ApplicantExperience(_obj_smhr_applicant); RG_Experience.DataSource = dt; RG_Experience.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { //To load super modules // Session["SUPERMODULE_ID"] = null; SMHR_FORMS _obj_Smhr_forms = new SMHR_FORMS(); _obj_Smhr_forms.MODE = 7; _obj_Smhr_forms.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt = BLL.get_Modules(_obj_Smhr_forms); ViewState["SUPER_MODULES"] = dt; rcmb_module.DataSource = dt; rcmb_module.DataTextField = "SMHR_SUP_MODULE_NAME"; rcmb_module.DataValueField = "SMHR_SUP_MODULE_ID"; rcmb_module.DataBind(); if (Convert.ToInt32(Session["EMP_ID"]) == (-1)) { rcmb_module.Enabled = false; } else { rcmb_module.SelectedIndex = rcmb_module.FindItemIndexByValue((Convert.ToInt32(Session["SUPERMODULE_ID"])).ToString()); } lblyear.Text = Convert.ToString(DateTime.Now.Year); if (Session["USERNAME"] == null) { Response.Redirect("~/Login.aspx", false); } if (Session["ORG_ID"] == null) { Response.Redirect("~/Login.aspx", false); } DataTable dtGlobal = BLL.ExecuteQuery(" EXEC USP_SMHR_GLOBALCONFIG @OPERATION = 'Check',@GLOBALCONFIG_ORGANISATION_ID = '" + Convert.ToString(Session["ORG_ID"]) + "'"); if (dtGlobal.Rows.Count != 0) { string temp = Convert.ToString(BLL.ExecuteQuery(" EXEC USP_SMHR_GLOBALCONFIG @OPERATION = 'Check',@GLOBALCONFIG_ORGANISATION_ID = '" + Convert.ToString(Session["ORG_ID"]) + "'").Rows[0]["GLOBALCONFIG_COMPANYLOGO"]); string temp1 = Convert.ToString(BLL.ExecuteQuery(" EXEC USP_SMHR_GLOBALCONFIG @OPERATION = 'Check',@GLOBALCONFIG_ORGANISATION_ID = '" + Convert.ToString(Session["ORG_ID"]) + "'").Rows[0]["GLOBALCONFIG_COMPANYLOGO_WIDTH"]); string temp2 = Convert.ToString(BLL.ExecuteQuery(" EXEC USP_SMHR_GLOBALCONFIG @OPERATION = 'Check',@GLOBALCONFIG_ORGANISATION_ID = '" + Convert.ToString(Session["ORG_ID"]) + "'").Rows[0]["GLOBALCONFIG_COMPANYLOGO_HEIGHT"]); // img_CompLogo.ImageUrl = temp; // img_CompLogo.Width = Unit.Pixel(Convert.ToInt32(temp1)); // img_CompLogo.Height = Unit.Pixel(Convert.ToInt32(temp2)); } string Name = string.Empty; if (Convert.ToInt32(Session["EMP_ID"]) > 0) { string fName = string.Empty; string mName = string.Empty; string lName = string.Empty; _obj_smhr_employee = new SMHR_EMPLOYEE(); _obj_smhr_employee.OPERATION = operation.Select; _obj_smhr_employee.EMP_ID = Convert.ToInt32(Session["EMP_ID"]); _obj_smhr_employee.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt_Details = BLL.get_Employee(_obj_smhr_employee); if (dt_Details.Rows.Count > 0) { _obj_smhr_applicant = new SMHR_APPLICANT(); _obj_smhr_applicant.OPERATION = operation.Select; _obj_smhr_applicant.APPLICANT_ID = Convert.ToInt32(Convert.ToString(dt_Details.Rows[0][2])); _obj_smhr_applicant.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dtApp = BLL.get_Applicant(_obj_smhr_applicant); if (dtApp.Rows.Count > 0) { fName = Convert.ToString(dtApp.Rows[0]["APPLICANT_FIRSTNAME"]); mName = Convert.ToString(dtApp.Rows[0]["APPLICANT_MIDDLENAME"]); lName = Convert.ToString(dtApp.Rows[0]["APPLICANT_LASTNAME"]); } } string strnew = fName.ToUpper().Replace(" ", " ") + " " + mName.ToUpper().Replace(" ", " ") + " " + lName.ToUpper().Replace(" ", " "); Name = strnew; } else { Name = string.Empty; } if (Session["USER_ID"] != null) { Lnk_LogOut.Visible = true; lnk_Home.Visible = true; if (Name == string.Empty) { hyp_Name.Text = Convert.ToString(Session["USERNAME"]); } else { hyp_Name.Text = Name; } } if (Session["ORG_NAME"] != null) { lbl_org.Text = Convert.ToString(Session["ORG_NAME"]); } if (Session["EMP_TYPE"] != null) { GetMenu(Convert.ToString(Session["EMP_TYPE"])); } else { if (Request.FilePath.IndexOf("Login.aspx") == -1) { Response.Redirect("~/Login.aspx", false); } } if (Convert.ToInt32(Session["EMP_ID"]) > 0) { hypPasswordReset.Visible = false; pr.Visible = false; trOld.Visible = true; trPassReset.Visible = false; } else { hypPasswordReset.Visible = true; pr.Visible = true; trOld.Visible = false; trPassReset.Visible = true; } if (Session["USER_ID"] == null) { Response.Redirect("~/frm_SesstionExp.aspx", false); } } if (Session["USER_ID"] == null) { Response.Redirect("~/frm_SesstionExp.aspx", false); } BreadCrumb(); this.Page.Title = ":: Smart HR ::"; } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "SMHRMaster", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void btnLogin_Click(object sender, EventArgs e) { try { if (rtxtUserName.Text.Trim() == string.Empty || rtxtPassword.Text.Trim() == string.Empty) { if (rtxtUserName.Text.Trim() == string.Empty && rtxtPassword.Text.Trim() == string.Empty) { BLL.ShowMessage(this, " - User Name & Password cannot be empty"); rtxtUserName.Focus(); } else if (rtxtUserName.Text.Trim() == string.Empty) { BLL.ShowMessage(this, " - User Name cannot be empty"); rtxtUserName.Focus(); } else { BLL.ShowMessage(this, " - Password cannot be empty"); rtxtPassword.Focus(); } return; } // string str3; //str3= BLL.PasswordEncrypt("krishna.k"); //string str4; //str4= BLL.PasswordEncrypt("123456kK"); //bool rs1 = GetCredentials(); //if (rs1 == true) //{ // Response.Redirect("~/Masters/frm_error.aspx", false); //} //else //{ Session.Remove("USERNAME"); Session.Remove("USER_ID"); Session.Remove("EMP_ID"); Session.Remove("EMP_TYPE"); Session.Remove("Control"); Session.Remove("SELFSERVICE"); Session.Remove("BUSINESSUNIT_ID"); Session.Remove("DASHBOARD"); Session.Remove("window"); Session.Remove("ORG_NAME"); Session.Remove("EMPNAME"); Session.Remove("USER_GROUP"); //newly added by sravani 23.02.2011 //#if (DEBUG) blnVerified = true; //#else //blnVerified = GetMACAddress(); //#endif if (blnVerified == true) { DataTable dt = new DataTable(); dt = BLL.get_Users(rtxtUserName.Text); //dt = BLL.get_pwd(rtxtUserName.Text, Convert.ToInt32(rcmb_org.SelectedItem.Value)); if (dt.Rows.Count != 0) { if (rtxtUserName.Text.ToUpper() == Convert.ToString(dt.Rows[0]["LOGIN_USERNAME"]).ToUpper().Trim() && rtxtPassword.Text == BLL.PasswordDecrypt(Convert.ToString(dt.Rows[0]["LOGIN_PASSWORD"])) && Convert.ToString(dt.Rows[0]["LOGIN_STATUS"]).ToUpper() == "TRUE") { Session["USERNAME"] = rtxtUserName.Text.ToUpper(); Session["USER_ID"] = Convert.ToString(dt.Rows[0]["LOGIN_ID"]); Session["EMP_ID"] = Convert.ToString(dt.Rows[0]["LOGIN_EMP_ID"]); Session["EMP_TYPE"] = Convert.ToString(dt.Rows[0]["LOGIN_TYPE"]); Session["ORG_ID"] = Convert.ToString(dt.Rows[0]["LOGIN_ORGANISATION_ID"]); Session["BUSINESSUNIT_ID"] = Convert.ToString(dt.Rows[0]["LOGIN_BUSINESSUNITID"]); Session["ORG_NAME"] = Convert.ToString(dt.Rows[0]["ORGANISATION_NAME"]); Session["USER_GROUP"] = Convert.ToString(dt.Rows[0]["LOGTYP_UNIQUEID"]); Session["LOGTYP_CODE"] = Convert.ToString(dt.Rows[0]["LOGTYP_CODE"]); //Session["EMPNAME"] = dt.Rows[0]["NAME"] != null ? Convert.ToString(dt.Rows[0]["NAME"]).Trim() : ""; USER_LOG(); if (BLL.PasswordDecrypt(Convert.ToString(dt.Rows[0]["LOGIN_PASSWORD"])) == "123456aA") { ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "function pageLoad(){ lnk_pass_Click(); }", true); return; } if (chk_Remember.Checked) { if (Request.Browser.Cookies) { if (Request.Cookies["PBLOGIN"] == null) { Response.Cookies["PBLOGIN"].Values["UNAME"] = rtxtUserName.Text; //Response.Cookies["PBLOGIN"].Values["UORG"] = rcmb_org.SelectedItem.Value; Response.Cookies["PBLOGIN"].Values["UPASS"] = rtxtPassword.Text.ToString().Trim(); } else { Response.Cookies["PBLOGIN"].Values["UNAME"] = rtxtUserName.Text; //Response.Cookies["PBLOGIN"].Values["UORG"] = rcmb_org.SelectedItem.Value; Response.Cookies["PBLOGIN"].Values["UPASS"] = rtxtPassword.Text.ToString().Trim(); } } } //FormsAuthentication.RedirectFromLoginPage(rtxtUserName.Text.ToUpper(), false); DataTable dt1 = BLL.get_1259735(); if (dt1.Rows.Count != 0) { switch (Convert.ToString(dt1.Rows[0][0])) { case "6rAoGC7EbQxz7FSee5gSCKsSCWJkUsWCvt4EVz99O0s=": //Enterprise : 1543768902 Response.Redirect("Loading.aspx", false); break; case "z061eEXQ5RKrb9W21ltqmiD1EhZ16HzTcS1OK9Mx4rg=": //LimitedUser : 1457386092 Response.Redirect("Loading.aspx", false); break; case "R6pOj1wf7Gz42/BLR+nWbxodHDQ6SWsDL2NbzyQPlTw=": //Hosted Model : 290683754 string str = BLL.PasswordDecrypt(Convert.ToString(dt1.Rows[0][2])); //DateTime dtTime = new DateTime(); //DateTime dtTime = DateTime.ParseExact(str, "dd/MM/yyyy", null); if (str != null) { DateTime dtTime = DateTime.ParseExact(str, "MM/dd/yyyy", System.Globalization.CultureInfo.InvariantCulture); //DateTime dtTime = Convert.ToDateTime(str); //DateTime dtTime=DateTime.Parse(str, System.Globalization.CultureInfo.CreateSpecificCulture("en-GB")); //DateTime dtTime = DateTime.ParseExact(str, "dd/MM/yyyy", null); DateTime Today = Convert.ToDateTime(DateTime.Now.ToShortDateString()); TimeSpan dt_1 = dtTime - Today; double Days = (dt_1.TotalDays) / 365.25; if (Days < 0) { Response.Redirect("Default.aspx", false); return; } else { bool status = false; status = checkRole(); Session["checkRole"] = status; if (Convert.ToInt32(Session["EMP_ID"]) > 0) { //TO GET D DATEFORMAT FOR D BUSINESSUNIT, 21.03.2012 _obj_smhr_logininfo = new SMHR_LOGININFO(); _obj_smhr_logininfo.OPERATION = operation.Empty1; _obj_smhr_logininfo.LOGIN_EMP_ID = Convert.ToInt32(Session["EMP_ID"]); DataTable dt_date = BLL.get_DateFormat(_obj_smhr_logininfo); if (dt_date.Rows.Count > 0) { if (Convert.ToString(dt_date.Rows[0]["DATEFORMAT_FORMAT"]).ToUpper() == "DD/MM/YYYY") { Session["DATE_FORMAT"] = Convert.ToString(dt_date.Rows[0]["DATEFORMAT_FORMAT"]); } else if (Convert.ToString(dt_date.Rows[0]["DATEFORMAT_FORMAT"]).ToUpper() == "MM/DD/YYYY") { Session["DATE_FORMAT"] = Convert.ToString(dt_date.Rows[0]["DATEFORMAT_FORMAT"]); } else { Session["DATE_FORMAT"] = Convert.ToString(dt_date.Rows[0]["DATEFORMAT_FORMAT"]); } } _obj_Smhr_Employee = new SMHR_EMPLOYEE(); _obj_Smhr_Employee.OPERATION = operation.Select; _obj_Smhr_Employee.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Smhr_Employee.EMP_ID = Convert.ToInt32(Session["EMP_ID"]); DataTable dtEmp = BLL.get_Employee(_obj_Smhr_Employee); if (dtEmp.Rows.Count > 0) { _obj_smhr_applicant = new SMHR_APPLICANT(); _obj_smhr_applicant.APPSKL_APPLICANT_ID = Convert.ToInt32(dtEmp.Rows[0]["EMP_APPLICANT_ID"]); _obj_smhr_applicant.OPERATION = operation.Check; DataTable dtAppSkill = BLL.get_ApplicantSkills(_obj_smhr_applicant); //if (dtAppSkill.Rows.Count > 0) //{ FormsAuthentication.RedirectFromLoginPage(rtxtUserName.Text.ToUpper(), false); if (status == true) { Session["SELFSERVICE"] = "true"; lblSession.Value = Convert.ToString(Session["SELFSERVICE"]); Response.Redirect("~/Security/frm_Dashboard.aspx", false); Session["PendingKra"] = 1; //To show HR & Payroll by default by sravani Session["SUPERMODULE_ID"] = 1; //To select super modules //Response.Redirect("frm_Menus.aspx", false); } else { Session["SELFSERVICE"] = ""; lblSession.Value = Convert.ToString(Session["SELFSERVICE"]); Response.Redirect("~/Security/frm_Dashboradmngr.aspx", false); Session["PendingKra"] = 1; //To show HR & Payroll by default by sravani Session["SUPERMODULE_ID"] = 1; //Response.Redirect("frm_Menus.aspx", false); } //} //else //{ // if (Convert.ToInt32(Session["EMP_ID"]) > 0) // { // Session["SUPERMODULE_ID"] = 1; // if (status == true) // { // Session["SELFSERVICE"] = "true"; // lblSession.Value = Convert.ToString(Session["SELFSERVICE"]); // //ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "function pageLoad(){ ShowPop(); }", true); // return; // } // else // { // Session["SELFSERVICE"] = ""; // lblSession.Value = Convert.ToString(Session["SELFSERVICE"]); // //ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "function pageLoad(){ ShowPop(); }", true); // return; // } // } //} } //FormsAuthentication.RedirectFromLoginPage(rtxtUserName.Text.ToUpper(), false); //if (status == true) //{ // Session["SELFSERVICE"] = "true"; // Response.Redirect("~/Security/frm_Dashboard.aspx", false); // //To show HR & Payroll by default by sravani // Session["SUPERMODULE_ID"] = 1; // //To select super modules // //Response.Redirect("frm_Menus.aspx", false); //} //else //{ // Session["SELFSERVICE"] = ""; // Response.Redirect("~/Security/frm_Dashboradmngr.aspx", false); // //To show HR & Payroll by default by sravani // Session["SUPERMODULE_ID"] = 1; // //Response.Redirect("frm_Menus.aspx", false); //} } else { //TO GET D DATEFORMAT FOR THE ORGANISATION, 21.03.2012 _obj_smhr_logininfo = new SMHR_LOGININFO(); _obj_smhr_logininfo.OPERATION = operation.Empty2; _obj_smhr_logininfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt_date = BLL.get_DateFormat(_obj_smhr_logininfo); if (dt_date.Rows.Count > 0) { if (Convert.ToString(dt_date.Rows[0]["DATEFORMAT_FORMAT"]).ToUpper() == "DD/MM/YYYY") { Session["DATE_FORMAT"] = Convert.ToString(dt_date.Rows[0]["DATEFORMAT_FORMAT"]); } else if (Convert.ToString(dt_date.Rows[0]["DATEFORMAT_FORMAT"]).ToUpper() == "MM/DD/YYYY") { Session["DATE_FORMAT"] = Convert.ToString(dt_date.Rows[0]["DATEFORMAT_FORMAT"]); } else { Session["DATE_FORMAT"] = Convert.ToString(dt_date.Rows[0]["DATEFORMAT_FORMAT"]); } } FormsAuthentication.RedirectFromLoginPage(rtxtUserName.Text.ToUpper(), false); Session["SELFSERVICE"] = "ADMIN"; Response.Redirect("~/Masters/Default.aspx", false); //To show HR & Payroll by default by sravani Session["SUPERMODULE_ID"] = 1; } } } break; default: return; } } else { FormsAuthentication.RedirectFromLoginPage(rtxtUserName.Text.ToUpper(), false); Response.Redirect("~/Masters/Default.aspx", false); //To show HR & Payroll by default by sravani Session["SUPERMODULE_ID"] = 1; //Response.Redirect("frm_Menus.aspx", false); return; } } else { failure.Visible = true; BLL.ShowMessage(this, "Login Failed. Incorrect User Name/Password"); //rtxtUserName_TextChanged(null, null); //lbl_failure.Visible = true; return; } } else { failure.Visible = true; BLL.ShowMessage(this, "Login Failed. Incorrect User Name."); //lbl_failure.Visible = true; return; } } else { BLL.ShowMessage(this, "Please contact Dhanush Infotech"); return; } //} } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Login", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void btn_Skill_Add_Click(object sender, EventArgs e) { try { getEmployee(); if (Check_Combo(RG_Skills, "lbl_Skill_ID", rcb_Skill)) { if (Mode == 0) { btn_Skill_Add.Enabled = false; dt_Skill = (DataTable)ViewState["dt_Skill"]; if (dt_Skill.Columns.Count > 7) { DataRow dr1 = dt_Skill.NewRow(); //dr1[0] = "0"; dr1[2] = rcb_Skill.SelectedValue; dr1[3] = rcb_ExpertLevel.SelectedValue; dr1[4] = rcb_ExpertLevel.SelectedItem.Text; dr1[5] = rcb_Skill.SelectedItem.Text; dr1[6] = rcb_YearLastUsed.SelectedItem.Text; //dr1[7] = lbl_Rand.Text + "-" + dt_Skill.Rows.Count; dt_Skill.Rows.Add(dr1); } else { DataRow dr = dt_Skill.NewRow(); dr[0] = "0"; dr[1] = rcb_Skill.SelectedValue; dr[2] = rcb_Skill.SelectedItem.Text; dr[3] = rcb_YearLastUsed.SelectedItem.Text; dr[4] = rcb_ExpertLevel.SelectedValue; dr[5] = rcb_ExpertLevel.SelectedItem.Text; //dr[6] = lbl_Rand.Text + "-" + dt_Skill.Rows.Count; dt_Skill.Rows.Add(dr); } RG_Skills.DataSource = dt_Skill; RG_Skills.DataBind(); clearSkillFields(); Mode = 0; btn_Skill_Add.Enabled = true; } else if (Mode == 2) { btn_Skill_Add.Enabled = false; _obj_smhr_applicant = new SMHR_APPLICANT(); bool status = false; _obj_smhr_applicant.OPERATION = operation.Insert; _obj_smhr_applicant.APPLICANT_ID = Convert.ToInt32(ViewState["APP_ID"]); //Convert.ToInt32(HF_APID.Value); //Convert.ToInt32(_lbl_App_ID); _obj_smhr_applicant.APPSKL_SKILL_ID = Convert.ToInt32(rcb_Skill.SelectedItem.Value); _obj_smhr_applicant.APPSKL_LASTUSED = Convert.ToInt32(rcb_YearLastUsed.SelectedItem.Text); _obj_smhr_applicant.APPSKL_EXPERT = Convert.ToInt32(rcb_ExpertLevel.SelectedValue); _obj_smhr_applicant.APPSKL_CREATEDBY = Convert.ToInt32(Session["USER_ID"]); _obj_smhr_applicant.APPSKL_CREATEDDATE = DateTime.Now; status = BLL.set_ApplicantSkills(_obj_smhr_applicant);//no organisation column has found Mode = 2; clearSkillFields(); LoadSkill(); btn_Skill_Add.Enabled = true; } } else { BLL.ShowMessage(this, "This Skill Set has already been added"); rcb_Skill.Focus(); return; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frmEmpSkills", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void btn_Skill_Correct_Click(object sender, EventArgs e) { try { getEmployee(); if (Mode == 1) { dt_Skill = (DataTable)ViewState["dt_Skill"]; DataRow dr; //DataRow dr1 = dt_Skill.Rows.Find(rcb_Skill.SelectedValue); int RowIndex = 0; if (dt_Skill.Columns.Count > 7) { for (int index = 0; index < dt_Skill.Rows.Count; index++) { //if (dt_Skill.Rows[index].Equals(dr1)) //RowIndex = index; if (dt_Skill.Rows[index][2].ToString() == rcb_Skill.SelectedValue) { RowIndex = index; } } dr = dt_Skill.Rows[RowIndex]; dr.BeginEdit(); //dr[0] = "0"; dr[2] = rcb_Skill.SelectedValue; dr[5] = rcb_Skill.SelectedItem.Text; dr[6] = rcb_YearLastUsed.SelectedItem.Text; dr[3] = rcb_ExpertLevel.SelectedValue; dr[4] = rcb_ExpertLevel.SelectedItem.Text; dr.EndEdit(); } else { for (int index = 0; index < dt_Skill.Rows.Count; index++) { //if (dt_Skill.Rows[index].Equals(dr1)) //RowIndex = index; if (dt_Skill.Rows[index][1].ToString() == rcb_Skill.SelectedValue) { RowIndex = index; } } dr = dt_Skill.Rows[RowIndex]; dr.BeginEdit(); //dr[0] = "0"; dr[1] = rcb_Skill.SelectedValue; dr[2] = rcb_Skill.SelectedItem.Text; dr[3] = rcb_YearLastUsed.SelectedItem.Text; dr[4] = rcb_ExpertLevel.SelectedValue; dr[5] = rcb_ExpertLevel.SelectedItem.Text; dr.EndEdit(); } Mode = 0; RG_Skills.DataSource = dt_Skill; RG_Skills.DataBind(); clearSkillFields(); btn_Skill_Add.Visible = true; btn_Skill_Correct.Visible = false; rcb_Skill.Enabled = true; } else { _obj_smhr_applicant = new SMHR_APPLICANT(); bool status = false; _obj_smhr_applicant.OPERATION = operation.Update; string lbl = _lbl_ID; _obj_smhr_applicant.APPSKL_ID = Convert.ToInt32(_lbl_ID); _obj_smhr_applicant.APPLICANT_ID = Convert.ToInt32(ViewState["APP_ID"]); //Convert.ToInt32(HF_APID.Value); //Convert.ToInt32(_lbl_App_ID); _obj_smhr_applicant.APPSKL_SKILL_ID = Convert.ToInt32(rcb_Skill.SelectedItem.Value); _obj_smhr_applicant.APPSKL_LASTUSED = Convert.ToInt32(rcb_YearLastUsed.SelectedItem.Text); _obj_smhr_applicant.APPSKL_EXPERT = Convert.ToInt32(rcb_ExpertLevel.SelectedValue); _obj_smhr_applicant.APPSKL_LASTMDFBY = 1; _obj_smhr_applicant.APPSKL_LASTMDFDATE = DateTime.Now; status = BLL.set_ApplicantSkills(_obj_smhr_applicant); Mode = 2; LoadSkill(); clearSkillFields(); rcb_Skill.Enabled = true; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frmEmpSkills", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void btn_Submit_Click(object sender, EventArgs e) { try { _obj_Smhr_Applicant = new SMHR_APPLICANT(); _obj_Smhr_Employee = new SMHR_EMPLOYEE(); _obj_Smhr_Asset_Clearance = new SMHR_EMP_ASSET_CLEARANCE(); int count = 0; if (rad_Employees.SelectedItem.Text == "Select") { BLL.ShowMessage(this, "Please select an Employee"); return; } if (Rad_Department.SelectedItem.Text == "Select") { BLL.ShowMessage(this, "Please select a Department"); return; } if (Rg_DepartmentswithAssets.Items.Count == 0) { BLL.ShowMessage(this, "No Assets for the Employee"); return; } if (rad_Employees.SelectedIndex > 0) { _obj_Smhr_Employee.EMP_ID = Convert.ToInt32(rad_Employees.SelectedValue); } else { if (ViewState["SelectedEmployee"] != null) { _obj_Smhr_Employee.EMP_ID = Convert.ToInt32(ViewState["SelectedEmployee"]); } else { BLL.ShowMessage(this, "No Employees for Clearance"); return; } } if (txt_Address != null && txt_Address.Text != string.Empty) { _obj_Smhr_Applicant.APPLICANT_ADDRESS = Convert.ToString(txt_Address.Text); } if (txt_Telephone != null && txt_Telephone.Text != string.Empty) { _obj_Smhr_Employee.EMP_MOBILENO = Convert.ToString(txt_Telephone.Text); } Label lbl_Asset_Id = new Label(); CheckBox chkBox = new CheckBox(); bool status = false; foreach (GridDataItem item in Rg_DepartmentswithAssets.Items) { chkBox = item.FindControl("chkChoose") as CheckBox; if (chkBox.Checked) { count++; RadComboBox radReceivedPayable = item.FindControl("radReceivedPayable") as RadComboBox; lbl_Asset_Id = item.FindControl("lbl_Asset_Id") as Label; if (radReceivedPayable.SelectedItem.Text != "Select") { RadTextBox rad_Reason = item.FindControl("rad_Reason") as RadTextBox; _obj_Smhr_Asset_Clearance.EMP_ASSET_CLEARANCE_REMARKS = Convert.ToString(rad_Reason.Text); } else { BLL.ShowMessage(this, "Please select Received/Amount Payable"); return; } RadTextBox rad_Amount = item.FindControl("rad_Amount") as RadTextBox; if (rad_Amount != null && rad_Amount.Text != string.Empty) { _obj_Smhr_Asset_Clearance.EMP_ASSET_CLEARANCE_AMOUNT = Convert.ToDecimal(rad_Amount.Text); } RadDatePicker rad_ReceievedDate = item.FindControl("rad_ReceivedDate") as RadDatePicker; if (rad_ReceievedDate.SelectedDate == null) { BLL.ShowMessage(this, "Please select Date"); return; } else { _obj_Smhr_Asset_Clearance.EMP_ASSET_CLEARANCE_RECEIVED_DATE = Convert.ToDateTime(rad_ReceievedDate.SelectedDate.Value); } _obj_Smhr_Asset_Clearance.EMP_ASSET_CLEARANCE_ASSET_ID = Convert.ToInt32(lbl_Asset_Id.Text); _obj_Smhr_Asset_Clearance.EMP_ASSET_CLEARANCE_DEPT_ID = Convert.ToInt32(Rad_Department.SelectedValue); _obj_Smhr_Asset_Clearance.EMP_ASSET_CLEARANCE_RECEIEVED_BY = Convert.ToInt32(Session["EMP_ID"]); _obj_Smhr_Asset_Clearance._EMP_ASSET_CLEARANCE_DEPTHEADREMARKS = Convert.ToString(rad_DeptHeadRemarks.Text); _obj_Smhr_Asset_Clearance.EMP_ASSET_CLEARANCE_CREATEDBY = Convert.ToInt32(Session["USER_ID"]); _obj_Smhr_Asset_Clearance.EMP_ASSET_CLEARANCE_CREATEDDATE = DateTime.Now; _obj_Smhr_Asset_Clearance.EMP_ASSET_CLEARANCE_LSTMFDBY = Convert.ToInt32(Session["USER_ID"]); _obj_Smhr_Asset_Clearance.EMP_ASSET_CLEARANCE_LSTMFDDATE = DateTime.Now; _obj_Smhr_Employee = new SMHR_EMPLOYEE(); _obj_Smhr_Employee.OPERATION = operation.Select; _obj_Smhr_Employee.EMP_ID = Convert.ToInt32(rad_Employees.SelectedValue); _obj_Smhr_Employee.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt_Details = BLL.get_Employee(_obj_Smhr_Employee); if (dt_Details != null) { if (dt_Details.Rows.Count != 0) { if (!(Convert.ToBoolean(dt_Details.Rows[0]["EMPREG_IS_TERMINATED"])))//Normal Resignation { if (Convert.ToDateTime(Convert.ToString(dt_Details.Rows[0]["EMP_DOJ"])) > Convert.ToDateTime(rad_ReceievedDate.SelectedDate)) { BLL.ShowMessage(this, "Date Should be Greater than Employee Joining Date"); return; } else if (Convert.ToDateTime(Convert.ToString(dt_Details.Rows[0]["EMPREG_APPROVEDDATE"])) > Convert.ToDateTime(rad_ReceievedDate.SelectedDate)) { BLL.ShowMessage(this, "Date Should be Greater than Employee Resignation Approved Date"); return; } else { status = BLL.set_Assets_Clearance(_obj_Smhr_Asset_Clearance, _obj_Smhr_Employee, _obj_Smhr_Applicant); } } else { if (Convert.ToBoolean(dt_Details.Rows[0]["EMPREG_IS_TERMINATED"]))// Is Terminated { if (Convert.ToDateTime(Convert.ToString(dt_Details.Rows[0]["EMP_DOJ"])) > Convert.ToDateTime(rad_ReceievedDate.SelectedDate)) { BLL.ShowMessage(this, "Date Should be Greater than Employee Join Date"); return; } else if (Convert.ToDateTime(Convert.ToString(dt_Details.Rows[0]["EMP_RESGDATE"])) > Convert.ToDateTime(rad_ReceievedDate.SelectedDate)) { BLL.ShowMessage(this, "Date Should be Greater than Employee Resignation Date"); return; } else { status = BLL.set_Assets_Clearance(_obj_Smhr_Asset_Clearance, _obj_Smhr_Employee, _obj_Smhr_Applicant); } } } } if (status == true) { BLL.ShowMessage(this, "Asset(s) Successfully Received"); } else { BLL.ShowMessage(this, "Asset(s) not Received"); } } } } if (Rg_DepartmentswithAssets.Items.Count > 0) { if (count == 0) { BLL.ShowMessage(this, "Please Select Atleast One Asset"); return; } } Get_Employee_Assets(rad_Employees.SelectedValue); LoadEmployees(); //LoadDepartment(); Rad_Department.Items.Clear(); Rad_Department.ClearSelection(); radBU.Items.Clear(); LoadBusinessUnits(); tr_EmpDetails.Attributes.Add("style", "visibility:hidden;display:none"); table_AssetDetails.Attributes.Add("style", "visibility:hidden;display:none"); } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Clearance", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); return; } }