示例#1
0
    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 objUserPlaces   = new PIKCV.BUS.UserCVs();
        DataTable         dtUserPlacesAll = objUserPlaces.GetUserPlaces(this.smUserID, (int)this.smLanguageID);

        PIKCV.BUS.UserCVs objUserLabouringTypes = new PIKCV.BUS.UserCVs();
        DataTable         dtUserLabouringTypes  = objUserLabouringTypes.GetUserLabouringTypes(this.smUserID, (int)this.smLanguageID);


        foreach (DataRow dr in dtUserLabouringTypes.Rows)
        {
            foreach (ListItem li in chLabouringTypes.Items)
            {
                if (li.Value == dr["LabouringTypeID"].ToString())
                {
                    li.Selected = true;
                    break;
                }
            }
        }

        DataTable dtUserPlaceCountries = new DataTable();

        dtUserPlaceCountries.Columns.Add("PlaceID");
        dtUserPlaceCountries.Columns.Add("PlaceName");

        DataTable dtUserPlaceCities = dtUserPlaceCountries.Clone();

        foreach (DataRow dr in dtUserPlacesAll.Rows)
        {
            if (dr["PlaceTypeCode"].ToString() == ((int)PIKCV.COM.EnumDB.PlaceTypes.Country).ToString())
            {
                DataRow drNew = dtUserPlaceCountries.NewRow();
                drNew["PlaceID"]   = dr["PlaceID"].ToString();
                drNew["PlaceName"] = dr["PlaceName"].ToString();
                dtUserPlaceCountries.Rows.Add(drNew);
            }
            else
            {
                DataRow drNew = dtUserPlaceCities.NewRow();
                drNew["PlaceID"]   = dr["PlaceID"].ToString();
                drNew["PlaceName"] = dr["PlaceName"].ToString();
                dtUserPlaceCities.Rows.Add(drNew);
            }
        }

        DataBindHelper.BindListbox(ref lbSelectedCountries, dtUserPlaceCountries, "PlaceName", "PlaceID", "");
        DataBindHelper.BindListbox(ref lbSelectedCities, dtUserPlaceCities, "PlaceName", "PlaceID", "");


        DataTable dtCountries    = this.cmbCountries;
        DataTable dtCountriesNew = new DataTable();

        if (dtUserPlaceCountries.Rows.Count > 0)
        {
            dtCountriesNew.Columns.Add("PlaceID");
            dtCountriesNew.Columns.Add("PlaceName");

            bool add = true;
            foreach (DataRow drCache in dtCountries.Rows)
            {
                add = true;
                foreach (DataRow dr in dtUserPlaceCountries.Rows)
                {
                    if (dr["PlaceID"].ToString() == drCache["PlaceID"].ToString())
                    {
                        add = false;
                        break;
                    }
                }
                if (add)
                {
                    DataRow drNew = dtCountriesNew.NewRow();
                    drNew["PlaceID"]   = drCache["PlaceID"].ToString();
                    drNew["PlaceName"] = drCache["PlaceName"].ToString();
                    dtCountriesNew.Rows.Add(drNew);
                }
            }
        }
        else
        {
            dtCountriesNew = dtCountries.Copy();
        }

        DataTable dtTurkeyCities = this.cmbTurkeyCities;
        DataTable dtCitiesNew    = new DataTable();

        if (dtUserPlaceCities.Rows.Count > 0)
        {
            dtCitiesNew.Columns.Add("PlaceID");
            dtCitiesNew.Columns.Add("PlaceName");

            bool add = true;
            foreach (DataRow drCache in dtTurkeyCities.Rows)
            {
                add = true;
                foreach (DataRow dr in dtUserPlaceCities.Rows)
                {
                    if (dr["PlaceID"].ToString() == drCache["PlaceID"].ToString())
                    {
                        add = false;
                        break;
                    }
                }
                if (add)
                {
                    DataRow drNew = dtCitiesNew.NewRow();
                    drNew["PlaceID"]   = drCache["PlaceID"].ToString();
                    drNew["PlaceName"] = drCache["PlaceName"].ToString();
                    dtCitiesNew.Rows.Add(drNew);
                }
            }
        }
        else
        {
            dtCitiesNew = dtTurkeyCities.Copy();
        }

        DataBindHelper.BindListbox(ref lbCountries, dtCountriesNew, "PlaceName", "PlaceID", "");
        DataBindHelper.BindListbox(ref lbCities, dtCitiesNew, "PlaceName", "PlaceID", "");

        PIKCV.BUS.UserCVs objUserCV = new PIKCV.BUS.UserCVs();

        DataTable dtUserCV = objUserCV.GetUserCV(this.smUserID);

        bool HasTravelDifficulty = Convert.ToBoolean(dtUserCV.Rows[0]["HasTravelDifficulty"]);

        rdHasTravelDifficultyYes.Checked = HasTravelDifficulty;
        rdHasTravelDifficultyNo.Checked  = !HasTravelDifficulty;

        bool IsSmoking = Convert.ToBoolean(dtUserCV.Rows[0]["IsSmoking"]);

        rdIsSmokingYes.Checked = IsSmoking;
        rdIsSmokingNo.Checked  = !IsSmoking;

        ImgBtnSave.Visible     = (Convert.ToInt32(dtUserCV.Rows[0]["CvFocusCode"]) > (int)PIKCV.COM.EnumDB.CVFocusCode.References);
        ImgBtnContinue.Visible = !(ImgBtnSave.Visible);

        dvScript.InnerHtml = "<script>OtherDown('" + lbCities.ClientID + "', " + ((int)PIKCV.COM.EnumDB.Places.OtherPlaceID).ToString() + ")</script>";
    }