private void GetData() { PIKCV.BUS.User objUser = new PIKCV.BUS.User(); PIKCV.BUS.UserCVs objUserCV = new PIKCV.BUS.UserCVs(); this.dtUser = objUser.GetUserDetail(this.smUserID); this.dtUserCV = objUserCV.GetUserCV(this.smUserID); this.dtUserComputerKnowledge = objUserCV.GetUserComputerKnowledges(this.smUserID, (int)this.smLanguageID); this.dtUserEducationUniversity0 = objUserCV.GetUserEducations(this.smUserID, PIKCV.COM.EnumDB.EducationTypes.University0, PIKCV.COM.EnumDB.LanguageID.Turkish, false); this.dtUserEducationUniversity1 = objUserCV.GetUserEducations(this.smUserID, PIKCV.COM.EnumDB.EducationTypes.University1, PIKCV.COM.EnumDB.LanguageID.Turkish, false); this.dtUserEducationUniversity2 = objUserCV.GetUserEducations(this.smUserID, PIKCV.COM.EnumDB.EducationTypes.University2, PIKCV.COM.EnumDB.LanguageID.Turkish, false); this.dtUserEducationDoktorate = objUserCV.GetUserEducations(this.smUserID, PIKCV.COM.EnumDB.EducationTypes.Doktorate, PIKCV.COM.EnumDB.LanguageID.Turkish, false); this.dtUserEmployment = objUserCV.GetUserEmployment(this.smUserID, (int)this.smLanguageID); this.dtUserLabouringTypes = objUserCV.GetUserLabouringTypes(this.smUserID, (int)this.smLanguageID); this.dtUserLanguages = objUserCV.GetUserLanguages(this.smUserID, (int)this.smLanguageID); this.dtUserPlacementPreferences = objUserCV.GetUserPlaces(this.smUserID, (int)this.smLanguageID); this.dtUserPositions = objUserCV.GetUserPositions(this.smUserID, (int)this.smLanguageID); this.dtUserReferences = objUserCV.GetUserReferences(this.smUserID); this.dtUserSectors = objUserCV.GetUserSectors(this.smUserID, (int)this.smLanguageID); }
protected void Page_PreRender(object sender, EventArgs e) { PIKCV.BUS.UserCVs objUserEmploymentChooices = new PIKCV.BUS.UserCVs(); DataTable dtUserSectors = objUserEmploymentChooices.GetUserSectors(this.smUserID, (int)this.smLanguageID); DataTable dtUserPositions = objUserEmploymentChooices.GetUserPositions(this.smUserID, (int)this.smLanguageID); DataBindHelper.BindListbox(ref lbSelectedSectors, dtUserSectors, "SectorName", "SectorID"); DataBindHelper.BindListbox(ref lbSelectedPositions, dtUserPositions, "PositionName", "PositionID"); DataTable dtSectors = this.cmbSectors; DataTable dtSectorsNew = new DataTable(); if (dtUserSectors.Rows.Count > 0) { dtSectorsNew.Columns.Add("SectorID"); dtSectorsNew.Columns.Add("SectorName"); bool add = true; foreach (DataRow drCache in dtSectors.Rows) { add = true; foreach (DataRow dr in dtUserSectors.Rows) { if (dr["SectorID"].ToString() == drCache["SectorID"].ToString()) { add = false; break; } } if (add) { DataRow drNew = dtSectorsNew.NewRow(); drNew["SectorID"] = drCache["SectorID"].ToString(); drNew["SectorName"] = drCache["SectorName"].ToString(); dtSectorsNew.Rows.Add(drNew); } } } else { dtSectorsNew = dtSectors.Copy(); } DataTable dtPositions = this.cmbPositions; DataTable dtPositionsNew = new DataTable(); if (dtPositions.Rows.Count > 0) { dtPositionsNew.Columns.Add("PositionID"); dtPositionsNew.Columns.Add("PositionName"); bool add = true; foreach (DataRow drCache in dtPositions.Rows) { add = true; foreach (DataRow dr in dtUserPositions.Rows) { if (dr["PositionID"].ToString() == drCache["PositionID"].ToString()) { add = false; break; } if ((this.smEmployeeType != PIKCV.COM.EnumDB.EmployeeTypes.Unknown) && ((PIKCV.COM.EnumDB.EmployeeTypes)(Convert.ToInt32(drCache["PositionTypeCode"])) != this.smEmployeeType)) { add = false; break; } } if (add) { DataRow drNew; if (this.smEmployeeType != PIKCV.COM.EnumDB.EmployeeTypes.Unknown) { if (this.smEmployeeType == (PIKCV.COM.EnumDB.EmployeeTypes)(Convert.ToInt16(drCache["PositionTypeCode"]))) { drNew = dtPositionsNew.NewRow(); drNew["PositionID"] = drCache["PositionID"].ToString(); drNew["PositionName"] = drCache["PositionName"].ToString(); dtPositionsNew.Rows.Add(drNew); } } else { drNew = dtPositionsNew.NewRow(); drNew["PositionID"] = drCache["PositionTypeCode"] + "_||" + drCache["PositionID"].ToString(); drNew["PositionName"] = drCache["PositionName"].ToString(); dtPositionsNew.Rows.Add(drNew); } } } } else { dtPositionsNew = dtPositions.Copy(); } DataBindHelper.BindListbox(ref lbSectors, dtSectorsNew, "SectorName", "SectorID", "0"); DataBindHelper.BindListbox(ref lbPositions, dtPositionsNew, "PositionName", "PositionID", "0"); PIKCV.BUS.UserCVs objUserCV = new PIKCV.BUS.UserCVs(); DataTable dtUserCV = objUserCV.GetUserCV(this.smUserID); ImgBtnSave.Visible = (Convert.ToInt32(dtUserCV.Rows[0]["CvFocusCode"]) > (int)PIKCV.COM.EnumDB.CVFocusCode.References); ImgBtnContinue.Visible = !(ImgBtnSave.Visible); }