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 grdaddemp_RowEditing1(object sender, GridViewEditEventArgs e) { GridViewRow row = grdaddemp.Rows[e.NewEditIndex]; Label lblid = (Label)row.FindControl("Label1"); Session["CandID"] = lblid.Text; int id = Convert.ToInt32(lblid.Text); Label lblname = (Label)row.FindControl("Label2"); Session["candName"] = lblname.Text; string name = lblname.Text; Label lblloc = (Label)row.FindControl("Label4"); Session["loc"] = lblloc.Text; string loc = lblloc.Text; ICandidateBLL obj = CandidateFactoryBLL.createCandidateBLobj(); ICandidateBO objBo = CandidateFactoryBO.createEmployeeBO(id); Session["DOB"] = Convert.ToString(obj.getDob(id)); Session["Gender"] = obj.getGender(id); Session["DOJ"] = Convert.ToString(obj.getDoj(id)); Session["ProjectID"] = Convert.ToString(obj.getProjectID(id)); Response.Redirect("AddEmployeeDetails_HR.aspx"); grdaddemp.EditIndex = -1; }