protected void Button1_Click(object sender, EventArgs e) { try { IEmployeeBLL objEmployeeMng = EmployeeFactoryBLL.createEmployeeBLobj(); IEmployeeBO objEmployee = EmployeeBOFactory.createEmpBO(); objEmployee.EmployeeName = txtempname.Text; objEmployee.DOJ = DateTime.Parse(txtdoj.Text); objEmployee.DOB = DateTime.Parse(txtdob.Text); objEmployee.Location = txtloc.Text; objEmployee.Gender = txtgend.Text; objEmployee.CTC = Convert.ToInt32(txtctc.Text); objEmployee.Designation = txtdesignation.Text; objEmployee.UnitHeadID = Convert.ToInt32(ddlunithead.SelectedValue); objEmployee.ProjectId = 100001; int ID = objEmployeeMng.addEmployee(objEmployee); int id = Int32.Parse(Session["CandID"].ToString()); ICandidateBLL obj = CandidateFactoryBLL.createCandidateBLobj(); ICandidateBO objBo = CandidateFactoryBO.createEmployeeBO(id); obj.deleteCandidate(id); Response.Write("<script>if(confirm('Details Submitted Successfully. Employee ID :" + ID + "')){document.location='AddSelectedCandidates_HR.aspx';}</script>"); } catch (Exception) { } }
protected void BtnUpdate_Click(object sender, EventArgs e) { try { string empName = txtEmpName.Text; string designation = txtdesignation.Text; Int32 ctc = Convert.ToInt32(txtctc.Text); Int32 unitHead = Convert.ToInt32(txtUnitHead.Text); IEmployeeBO objBo = EmployeeBOFactory.createEmployeeBO(empName, designation, ctc, unitHead); IEmployeeBLL objBll = EmployeeFactoryBLL.createEmployeeBLL(); int res = objBll.editEmployees(objBo); if (res > 0) { Response.Write("<script>if(confirm('Employee Details Updated Successfully.')){document.location='EditEmployeeDetails.aspx';}</script>"); } else { Response.Write("<script>if(confirm('Employee not Details Updated Successfully.')){document.location='EditEmployeeDetails.aspx';}</script>"); } } catch (Exception) { } }
protected void Page_Load(object sender, EventArgs e) { try { txtempname.Text = Session["candName"].ToString(); txtloc.Text = Session["loc"].ToString(); txtgend.Text = Session["Gender"].ToString(); var dateTimeNow = DateTime.Parse(Session["DOB"].ToString()); txtdob.Text = dateTimeNow.ToShortDateString(); var dateTimeNow1 = DateTime.Parse(Session["DOJ"].ToString()); txtdoj.Text = dateTimeNow1.ToShortDateString(); txtPid.Text = Session["ProjectID"].ToString(); if (!IsPostBack) { IEmployeeBLL objEmpBLL = EmployeeFactoryBLL.createEmployeeBLL(); List <int> list1 = objEmpBLL.getUnitHeadID(); ddlunithead.DataSource = list1; ddlunithead.DataBind(); ddlunithead.Items.Insert(0, "--Select--"); } } catch (Exception) { } }
protected void BGCgrdview_RowUpdating(object sender, GridViewUpdateEventArgs e) { try { GridViewRow row = BGCgrdview.Rows[e.RowIndex]; Label lbladminid2 = (Label)row.FindControl("lbladminid2"); DropDownList ddlstatus = (DropDownList)row.FindControl("ddlstatus"); Label lblStatusChangeTime2 = (Label)row.FindControl("lblStatusChangeTime2"); int adminid = Convert.ToInt32(lbladminid2.Text); string status = ddlstatus.SelectedValue; DateTime statuschangetime = DateTime.Now; IEmployeeBO objbo = EmployeeBOFactory.CreateEmployee(adminid, status, statuschangetime); IEmployeeBLL objbll = EmployeeFactoryBLL.createnew(); int check = objbll.displayapproved(objbo); if (check > 0) { BGCgrdview.EditIndex = -1; bgcdata(); } else { Response.Redirect("<script>alert('Employee details are not updated please update again')</script>"); } } catch (Exception ex) { Response.Write("<script>alert('Exception: " + ex.Message + "');</script>"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { IEmployeeBLL objEmpBLL = EmployeeFactoryBLL.createEmployeeBLL(); List <int> list = objEmpBLL.getEmployeeID(); ddlEmpID.DataSource = list; ddlEmpID.DataBind(); ddlEmpID.Items.Insert(0, "--Select--"); } }
private void databind() { try { IEmployeeBLL empbll = EmployeeFactoryBLL.createnew(); List <IEmployeeBO> newlist = empbll.displayall(); viewgrdapproved.DataSource = newlist; viewgrdapproved.DataBind(); } catch (Exception ex) { Response.Write("<script>alert('Exception: " + ex.Message + "');</script>"); } }
private void bgcdata() { try { IEmployeeBLL objbll = EmployeeFactoryBLL.createnew(); List <IEmployeeBO> list = objbll.displayunithead(); BGCgrdview.DataSource = list; BGCgrdview.DataBind(); } catch (Exception ex) { Response.Write("<script>alert('Exception: " + ex.Message + "');</script>"); } }
private void bindddl() { try { //List<IEmployeeBO> dispemp = new List<IEmployeeBO>(); //IEmployeeBO empbo = EmployeeBOFactory.CreateEmployee(); IEmployeeBLL empbll = EmployeeFactoryBLL.createnew(); ddlAdmin.DataSource = empbll.displaydropdown(); ddlAdmin.DataBind(); } catch (Exception ex) { Response.Write("<script>alert('Exception: " + ex.Message + "');</script>"); } }
private void binddata() { try { IEmployeeBLL empbll = EmployeeFactoryBLL.createnew(); List <IEmployeeBO> list = empbll.display(); addBGCview.Visible = true; addBGCview.DataSource = list; addBGCview.DataBind(); } catch (Exception ex) { Response.Write("<script>alert('Exception: " + ex.Message + "');</script>"); } }
protected void submit_button_Click(object sender, EventArgs e) { try { //for (int i = 0; i <= 5; i++) //{ int employeeid = Convert.ToInt32(ddlAdmin.SelectedItem.Text); string status = "Pending"; DateTime statusChangeTime = DateTime.Now; int role_id = 3; int administratorID = 0; IEmployeeBO empadd = EmployeeBOFactory.createemp(employeeid, status, statusChangeTime, role_id, administratorID); IEmployeeBLL empbll = EmployeeFactoryBLL.createnew(); List <IEmployeeBO> list = empbll.everythingdisplay(); //foreach (IEmployeeBO item in list) //{ // if(item.EmployeeID==500002) // Response.Write("found"); //} var match = list.Exists(p => p.EmployeeID == employeeid); if (match == false) { int check = empbll.addadmin(empadd); ddlAdmin.Items.Remove(ddlAdmin.SelectedItem.Text); if (check > 0) { binddata(); } } else { Response.Write("<script>alert('The employee selected is already a BGC ADMINISTRATOR please select another employee.');</script>"); ddlAdmin.Items.Remove(ddlAdmin.SelectedItem.Text); binddata(); } } catch (Exception ex) { Response.Write("<script>alert('Exception: " + ex.Message + "');</script>"); } }
protected void BtnSubmit_Click(object sender, EventArgs e) { try { LblEmpID.Visible = true; LblEmpName.Visible = true; LblDesgn.Visible = true; LblCTC.Visible = true; LblUnitHeadID.Visible = true; txtEmpID.Visible = true; txtEmpName.Visible = true; txtdesignation.Visible = true; txtctc.Visible = true; rectc.Visible = true; redesignation.Visible = true; rfvctc.Visible = true; rfvdesignation.Visible = true; txtUnitHead.Visible = true; BtnUpdate.Visible = true; BtnCancel.Visible = true; BtnSubmit.Visible = false; LblEmpID1.Visible = false; ddlEmpID.Visible = false; int id = Convert.ToInt32(ddlEmpID.SelectedValue); Session["empid"] = ddlEmpID.SelectedValue; txtEmpID.Text = Session["empid"].ToString(); IEmployeeBO objBo = EmployeeBOFactory.createEmployeeBO(id); IEmployeeBLL objBll = EmployeeFactoryBLL.createEmployeeBLL(); txtEmpName.Text = objBll.getEmpName(id); txtUnitHead.Text = Convert.ToString(objBll.getUnitHeadId(id)); txtctc.Text = Convert.ToString(objBll.getctc(id)); txtdesignation.Text = objBll.getDesignation(id); txtUnitHead.DataBind(); txtEmpName.DataBind(); ddlEmpID.Items.Insert(0, "--Select--"); } catch (Exception) { } }
protected void bindData() { try { for (int i = 0; i < 5; i++) { List <IEmployeeBO> list = EmployeeBOFactory.createEmployeeBO(); IEmployeeBLL objBLL = EmployeeFactoryBLL.createEmployeeBLL(); list = objBLL.ViewEmployee(); grdEmployee.DataSource = list; if (list.Count != 0) { grdEmployee.DataBind(); } else { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Employee Doesnot Exit')", true); } } }catch (Exception) { } }