/// <summary> /// Handles the ItemCommand event of rptrPastCurrentJobDetails control /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> protected void rptrPastCurrentJobDetails_ItemCommand(object source, RepeaterCommandEventArgs e) { Label lblCurrentComapny = (Label)e.Item.FindControl("lblCurrentComapny"); CheckBox chkCurrentYes = (CheckBox)e.Item.FindControl("chkCurrentYes"); Label lblCompanyName = (Label)e.Item.FindControl("lblCompanyName"); TextBox txtComapnyName = (TextBox)e.Item.FindControl("txtComapnyName"); Label lblDesignation = (Label)e.Item.FindControl("lblDesignation"); TextBox txtDesignation = (TextBox)e.Item.FindControl("txtDesignation"); Label lblRolesResponsibility = (Label)e.Item.FindControl("lblRolesResponsibility"); TextBox txtRolesResponsibility = (TextBox)e.Item.FindControl("txtRolesResponsibility"); Label lblFromMonth = (Label)e.Item.FindControl("lblFromMonth"); Label lblFromYear = (Label)e.Item.FindControl("lblFromYear"); Label lblTillMonth = (Label)e.Item.FindControl("lblTillMonth"); Label lblTillYear = (Label)e.Item.FindControl("lblTillYear"); DropDownList ddlFromMonth = (DropDownList)e.Item.FindControl("ddlFromMonth"); DropDownList ddlFromYear = (DropDownList)e.Item.FindControl("ddlFromYear"); DropDownList ddlTillMonth = (DropDownList)e.Item.FindControl("ddlTillMonth"); DropDownList ddlTillYear = (DropDownList)e.Item.FindControl("ddlTillYear"); Label lbltillword = (Label)e.Item.FindControl("lbltillword"); Label lblIndustry = (Label)e.Item.FindControl("lblIndustry"); Label lblDepartment = (Label)e.Item.FindControl("lblDepartment"); DropDownList ddlIndustry = (DropDownList)e.Item.FindControl("ddlIndustry"); DropDownList ddlDepartment = (DropDownList)e.Item.FindControl("ddlDepartment"); Label lblEmploymentStatus = (Label)e.Item.FindControl("lblEmploymentStatus"); RadioButtonList rbtlEmployementStatus = (RadioButtonList)e.Item.FindControl("rbtlEmployementStatus"); Label lblJobType = (Label)e.Item.FindControl("lblJobType"); RadioButtonList rblJobType = (RadioButtonList)e.Item.FindControl("rblJobType"); Label lblCompanyType = (Label)e.Item.FindControl("lblCompanyType"); RadioButtonList rblCompanyType = (RadioButtonList)e.Item.FindControl("rblCompanyType"); Label lblReasonforjobchange = (Label)e.Item.FindControl("lblReasonforjobchange"); TextBox txtReasonforJobchange = (TextBox)e.Item.FindControl("txtReasonforJobchange"); Label lblClientName = (Label)e.Item.FindControl("lblClientName"); TextBox txtClientName = (TextBox)e.Item.FindControl("txtClientName"); Label lblClientSite = (Label)e.Item.FindControl("lblClientSite"); TextBox txtClientSite = (TextBox)e.Item.FindControl("txtClientSite"); LinkButton lnkEdit = (LinkButton)e.Item.FindControl("lnkEdit"); LinkButton lnkDelete = (LinkButton)e.Item.FindControl("lnkDelete"); LinkButton lnkUpdate = (LinkButton)e.Item.FindControl("lnkUpdate"); LinkButton lnkCancel = (LinkButton)e.Item.FindControl("lnkCancel"); if (e.CommandName == "edit") { lblCurrentComapny.Visible = false; chkCurrentYes.Visible = true; lblCompanyName.Visible = false; txtComapnyName.Visible = true; lblDesignation.Visible = false; txtDesignation.Visible = true; lblRolesResponsibility.Visible = false; txtRolesResponsibility.Visible = true; lblFromMonth.Visible = false; lblFromYear.Visible = false; lblTillMonth.Visible = false; lblTillYear.Visible = false; ddlFromMonth.Visible = true; ddlFromYear.Visible = true; ddlTillMonth.Visible = true; ddlTillYear.Visible = true; lbltillword.Visible = true; lblEmploymentStatus.Visible = false; rbtlEmployementStatus.Visible = true; lblJobType.Visible = false; rblJobType.Visible = true; lblCompanyType.Visible = false; rblCompanyType.Visible = true; lblReasonforjobchange.Visible = false; txtReasonforJobchange.Visible = true; lblIndustry.Visible = false; lblDepartment.Visible = false; ddlIndustry.Visible = true; ddlDepartment.Visible = true; lblClientName.Visible = false; lblClientSite.Visible = false; txtClientName.Visible = true; txtClientSite.Visible = true; lnkEdit.Visible = false; lnkDelete.Visible = false; lnkUpdate.Visible = true; lnkCancel.Visible = true; } if (e.CommandName == "update") { CurrentDesiredJobEntity currentDesiredJobEntity = new CurrentDesiredJobEntity(); currentDesiredJobEntity.CurrentCompanyOrNot = chkCurrentYes.Checked.ToString(); currentDesiredJobEntity.CompanyName = txtComapnyName.Text.Trim(); currentDesiredJobEntity.Designation = txtDesignation.Text.Trim(); currentDesiredJobEntity.Industry = ddlIndustry.SelectedValue; currentDesiredJobEntity.RolesResponsibility = lblRolesResponsibility.Text.Trim(); currentDesiredJobEntity.FromMonth = ddlFromMonth.SelectedItem.Value; currentDesiredJobEntity.FromYear = ddlFromYear.SelectedItem.Value; currentDesiredJobEntity.TillMonth = ddlTillMonth.SelectedItem.Value; currentDesiredJobEntity.TillYear = ddlTillYear.SelectedItem.Value; currentDesiredJobEntity.CurrentEmploymentStatus = rbtlEmployementStatus.Text; currentDesiredJobEntity.JobType = rblJobType.Text; currentDesiredJobEntity.CompanyType = rblCompanyType.Text; currentDesiredJobEntity.ReasonForJobChange = txtReasonforJobchange.Text.Trim(); currentDesiredJobEntity.ClientName = txtClientName.Text.Trim(); currentDesiredJobEntity.ClientSite = txtClientSite.Text.Trim(); currentDesiredJobEntity.Department = ddlDepartment.SelectedValue; currentDesiredJobEntity.ExpId = Convert.ToInt32(e.CommandArgument); DataSet ds = new DataSet(); CurrentDesiredJobBAL currentDesiredJobBAL = new CurrentDesiredJobBAL(); currentDesiredJobBAL.UpdateCurrentPastExperienceDetailsBAL(currentDesiredJobEntity); BindRepeaterCurrentPastExp(); } if (e.CommandName == "delete") { int expId = Convert.ToInt32(e.CommandArgument); CurrentDesiredJobBAL currentDesiredJobBAL = new CurrentDesiredJobBAL(); currentDesiredJobBAL.DeleteCurrentPastJobDetailsBAL(expId); BindRepeaterCurrentPastExp(); } if (e.CommandName == "cancel") { BindRepeaterCurrentPastExp(); } }