protected void GridViewJobPostList_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { MyJobPortalModel.Department ObjDepartmentName = new MyJobPortalModel.Department(int.Parse(e.Row.Cells[2].Text)); e.Row.Cells[2].Text = ObjDepartmentName.DepartmentName; MyJobPortalModel.Designation ObjDesignationName = new MyJobPortalModel.Designation(int.Parse(e.Row.Cells[1].Text)); e.Row.Cells[1].Text = ObjDesignationName.DesignationName; } }
protected void GridViewHiringManager_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { MyJobPortalModel.Branch ObjBranch = new MyJobPortalModel.Branch(int.Parse(e.Row.Cells[2].Text)); e.Row.Cells[2].Text = ObjBranch.BranchName; MyJobPortalModel.Department ObjDepartment = new MyJobPortalModel.Department(int.Parse(e.Row.Cells[3].Text)); e.Row.Cells[3].Text = ObjDepartment.DepartmentName; } }
protected void Page_Load(object sender, EventArgs e) { if (this.IsPostBack == false) { TxtDepartment.Focus(); this.Form.DefaultButton = BtnUpdate.UniqueID; MyJobPortalModel.Department ObjDepartment = new MyJobPortalModel.Department(int.Parse(Request.QueryString["Id"])); TxtDepartment.Text = ObjDepartment.DepartmentName; DdlStatus.SelectedValue = ObjDepartment.Status; } }
protected void BtnUpdate_Click(object sender, EventArgs e) { if (this.IsValid == true) { bool AllOk = true; DataTable ObjDepartmentTable = MyJobPortalModel.Department.GetDepartmentRecords("DepartmentName ='" + TxtDepartment.Text.Replace("'", "''").Trim() + "' and Id<>" + Request.QueryString["Id"]); if ((int)ObjDepartmentTable.Rows.Count > 0) { LblDuplicateDepartmentError.Visible = true; AllOk = false; TxtDepartment.Focus(); return; } if (AllOk == true) { MyJobPortalModel.Department ObjDepartment = new MyJobPortalModel.Department(int.Parse(Request.QueryString["Id"])); ObjDepartment.DepartmentName = TxtDepartment.Text.Replace("'", "''"); ObjDepartment.Status = DdlStatus.SelectedValue; ObjDepartment.Update(); Response.Redirect("DepartmentList.aspx?Message=Record has been Updated"); } } }