protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) { try { GridViewRow row = GridView1.Rows[e.RowIndex]; ICandidateBO objBO = FactoryBO.CandidateFactoryBO.CreateCandidate(); HiddenField hdnfld = (HiddenField)row.FindControl("hdnField"); objBO.CandidateProfileID = Convert.ToInt32(hdnfld.Value); DropDownList ddlBGCStatus = (DropDownList)row.FindControl("DDlBGCStatus"); objBO.BGCTestStatus = ddlBGCStatus.SelectedItem.Text; TextBox txtRemarks = (TextBox)row.FindControl("TextBoxRemarks"); objBO.Remarks = txtRemarks.Text; // List<ICandidateBO> ListObjBO = new List<ICandidateBO>(); IBGCUpdatesBLL objBLL = FactoryBLL.BGCUpdatesFactoryBLL.CreateUpdatesBLL(); int ret = objBLL.UpdateBGCStatus_AdminBLL(objBO); if (ret > 0) { Response.Write("<script>alert('Updated Successfully')</script>"); } else { Response.Write("<script>alert('Error')</script>"); } GridView1.EditIndex = -1; bindBGCStatus(); //GridView1.DataSource = ListObjBO; //GridView1.DataBind(); } catch (Exception ex) { Response.Write("<script>alert('Exception: " + ex.Message + "');window.location ='Login1.aspx';</script>"); } }
// DateTime req = new DateTime(); protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) { List <int> DDLadminList = new List <int>(); IBGCUpdatesBLL objBLL = FactoryBLL.BGCUpdatesFactoryBLL.CreateUpdatesBLL(); DDLadminList = objBLL.fetch_DDLAdminBO(); DdlAdminID.Items.Add(new ListItem("--Select--", "0")); foreach (var item in DDLadminList) { DdlAdminID.Items.Add(new ListItem(item.ToString())); } List <int> DDLVacancyList = new List <int>(); IBGCUpdatesBLL objBLL2 = FactoryBLL.BGCUpdatesFactoryBLL.CreateUpdatesBLL(); DDLVacancyList = objBLL2.fetch_DDLVacBO(); DdlVacancyID.Items.Add(new ListItem("--Select--", "0")); foreach (var item in DDLVacancyList) { DdlVacancyID.Items.Add(new ListItem(item.ToString())); } DdlVacancyID.Enabled = false; RFVVacancyID.Enabled = false; TextBoxReqByDate.Text = "Please select a vacancy ID"; TextBoxReqByDate.Enabled = false; TextBoxFromDate.Text = x.ToString("yyyy-MM-dd"); TextBoxFromDate.Enabled = false; TextBoxToDate.Text = x.ToString("yyyy-MM-dd"); TextBoxToDate.Enabled = false; RFVFromDate.Enabled = false; RFVToDate.Enabled = false; RVFromDate.MaximumValue = x.AddDays(-1).ToString("MM-dd-yyyy"); RVFromDate.MinimumValue = x.AddDays(-7).ToString("MM-dd-yyyy"); RVToDate.MaximumValue = x.AddDays(-1).ToString("MM-dd-yyyy"); RVToDate.MinimumValue = x.AddDays(-7).ToString("MM-dd-yyyy"); } } catch (Exception ex) { Response.Write("<script>alert('Exception: " + ex.Message + "');window.location ='Login1.aspx';</script>"); } }
protected void bindBGCStatus() { try { List <ICandidateBO> ListObjBO = new List <ICandidateBO>(); IBGCUpdatesBLL objBLL = FactoryBLL.BGCUpdatesFactoryBLL.CreateUpdatesBLL(); ListObjBO = objBLL.DisplayBGCStatus_HR(); GridViewBGCStatusHR.DataSource = ListObjBO; GridViewBGCStatusHR.DataBind(); } catch (Exception ex) { Response.Write("<script>alert('Exception: " + ex.Message + "');window.location ='Login1.aspx';</script>"); } }
protected void bindBGCStatus() { int user = Convert.ToInt32(Session["BGCAdministratorID"]); try { List <ICandidateBO> ListObjBO = new List <ICandidateBO>(); IBGCUpdatesBLL objBLL = FactoryBLL.BGCUpdatesFactoryBLL.CreateUpdatesBLL(); ListObjBO = objBLL.EditBGCStatus_AdminBLL(user); GridView1.DataSource = ListObjBO; GridView1.DataBind(); } catch (Exception ex) { Response.Write("<script>alert('Exception: " + ex.Message + "');window.location ='Login1.aspx';</script>"); } }
protected void BtnChange_Click(object sender, EventArgs e) { try { string oldPass = TxtOldPass.Text; string newPass = TxtNewPass.Text; string confirmPass = TxtConfirmPass.Text; if (oldPass != "ChangePwd") { Response.Write("<script>alert('Please enter a valid Password')</script>"); } else if (oldPass == newPass) { Response.Write("<script>alert('Please enter a new Password')</script>"); } else if (newPass != confirmPass) { Response.Write("<script>alert('Password Mismatch')</script>"); } else { IBGCCheckBO objBO = FactoryBO.BGCCheckFactoryBO.CreateBGCCheck(); IBGCUpdatesBLL objBLL = FactoryBLL.BGCUpdatesFactoryBLL.CreateUpdatesBLL(); // objBO.EmpPass = oldPass; objBO.EmpID = Convert.ToInt32(Session["newEmp"]); objBO.NewEmpPass = confirmPass; int ret = objBLL.ChangePwdBLL(objBO); if (ret == 1) { Response.Write("<script>alert('Your password is updated successfully. Please login again with the new credentials to activate your account.');window.location ='Login1.aspx';</script>"); } else { Response.Write("<script>alert('Your password could not be updated. Please enter valid credentials.')</script>"); } //Response.Write("<script>alert('"+msg+"')</script>"); } } catch (Exception ex) { Response.Write("<script>alert('Exception: " + ex.Message + "');window.location ='Login1.aspx';</script>"); } }
//protected void DdlVacancyID_SelectedIndexChanged(object sender, EventArgs e) //{ //} protected void CreateBGCScheduleButton_Click(object sender, EventArgs e) { try { IBGCCheckBO objBO = FactoryBO.BGCCheckFactoryBO.CreateBGCCheck(); objBO.AdminID = Convert.ToInt32(DdlAdminID.SelectedItem.Text); objBO.VacancyID = Convert.ToInt32(DdlVacancyID.SelectedItem.Text); objBO.FromDate = Convert.ToDateTime(TextBoxFromDate.Text); objBO.ToDate = Convert.ToDateTime(TextBoxToDate.Text); IBGCUpdatesBLL objBLL = FactoryBLL.BGCUpdatesFactoryBLL.CreateUpdatesBLL(); int BGCID = objBLL.CreateBGCBLL(objBO); Response.Write("<script>alert('BGC schedule is created successfully. BGC ID: " + BGCID + "')</script>"); CreateBGCScheduleButton.Enabled = false; } catch (Exception ex) { Response.Write("<script>alert('Exception: " + ex.Message + "');window.location ='Login1.aspx';</script>"); } }
//protected void DdlVacancyID_TextChanged(object sender, EventArgs e) //{ //} protected void DdlVacancyID_SelectedIndexChanged(object sender, EventArgs e) { try { IBGCUpdatesBLL objBLL3 = FactoryBLL.BGCUpdatesFactoryBLL.CreateUpdatesBLL(); if (DdlVacancyID.SelectedValue == "0") { TextBoxReqByDate.Text = "Please select a vacancy ID"; TextBoxReqByDate.Enabled = false; TextBoxFromDate.Enabled = false; TextBoxToDate.Enabled = false; RFVFromDate.Enabled = false; RFVToDate.Enabled = false; } else { int VacId = Convert.ToInt32(DdlVacancyID.SelectedItem.Text); DateTime req = new DateTime(); req = objBLL3.fetch_ReqByDateBLL(VacId); Session["RBD"] = req; TextBoxReqByDate.Text = (req).ToString("MM-dd-yyyy"); TextBoxFromDate.Enabled = true; RFVFromDate.Enabled = true; TextBoxFromDate.Text = req.ToString("yyyy-MM-dd"); TextBoxToDate.Enabled = true; RFVToDate.Enabled = true; TextBoxToDate.Text = req.ToString("yyyy-MM-dd"); RVFromDate.Enabled = true; RVToDate.Enabled = true; RVFromDate.MaximumValue = req.AddDays(-1).ToString("MM-dd-yyyy"); RVFromDate.MinimumValue = req.AddDays(-7).ToString("MM-dd-yyyy"); // RVToDate.MaximumValue = req.AddDays(-1).ToString("MM-dd-yyyy"); // RVToDate.MinimumValue = req.AddDays(-6).ToString("MM-dd-yyyy"); } } catch (Exception ex) { Response.Write("<script>alert('Exception: " + ex.Message + "');window.location ='Login1.aspx';</script>"); } }
protected void Button1_Click(object sender, EventArgs e) { try { IBGCCheckBO objBO = FactoryBO.BGCCheckFactoryBO.CreateBGCCheck(); IBGCUpdatesBLL objBLL = FactoryBLL.BGCUpdatesFactoryBLL.CreateUpdatesBLL(); string User = txtusid.Text; string Pass = txtpwd.Text; Session["Pwd"] = Pass; if (User.Length == 6) { objBO = objBLL.Login_BGC(User); if (objBO.EmpPass == Pass) { if (objBO.EmpRole == "Employee") { Session["newEmp"] = User; Response.Redirect("Emloyee.aspx"); } else if (objBO.EmpRole == "Unit Head") { Response.Redirect("Homepage_UnitHead.aspx"); } else if (objBO.EmpRole == "HR") { Response.Redirect("Homepage_HR.aspx"); } else { // not employee Response.Write("<script>alert('Please enter a valid Username or Password')</script>"); } } else { //not employee Response.Write("<script>alert('Please enter a valid Username or Password')</script>"); } } else if (User.Length == 3) { objBO = objBLL.Login_BGCAdmin(User); Session["BGCAdministratorID"] = User; if (objBO.RoleID == 3 && objBO.EmpPass == Pass) { // if(objBO.EmpPass==Pass) // { Response.Redirect("Homepage_BGCAdmin.aspx"); // } } else { //not BGC admin Response.Write("<script>alert('Please enter a valid Username or Password')</script>"); } } { //not Admin Response.Write("<script>alert('Please enter a valid Username or Password')</script>"); } } catch (Exception ex) { Response.Write("<script>alert('Exception: " + ex.Message + "');window.location ='Login1.aspx';</script>"); } }