예제 #1
0
    //--------------------------------------------------------
    #endregion

    #region ---------------LoadData---------------
    //-----------------------------------------------
    //LoadData
    //-----------------------------------------------
    protected void LoadData()
    {
        if (MoversFW.Components.UrlManager.ChechIsValidParameter("id"))
        {
            Guid            userid          = new Guid(Request.QueryString["id"]);
            UsersDataEntity usersDataObject = UsersDataFactory.GetUsersDataObject(userid, OwnerID);
            if (usersDataObject != null)
            {
                //----------------------------------------------------------------------
                if (currentModule.HasName)
                {
                    txtName.Text = usersDataObject.Name;
                }
                //----------------------------------------------------------------------
                txtEmail.Text = usersDataObject.Email;
                //----------------------------------------------------------------------
                if (currentModule.CategoryLevel != 0)
                {
                    ddlCategoryID.SelectedValue = usersDataObject.CategoryID.ToString();
                }
                //----------------------------------------------------------------------
                if (currentModule.HasEmpNo)
                {
                    txtEmpNo.Text = usersDataObject.EmpNo.ToString();
                }
                //----------------------------------------------------------------------
                #region ----------Photo----------
                //-------------------------------------------
                //Photo
                //-------------------------------------------
                if (currentModule.HasPhotoExtension && !string.IsNullOrEmpty(usersDataObject.PhotoExtension))
                {
                    imgPhoto.ImageUrl = UsersDataFactory.GetUserPhotoThumbnail(usersDataObject.UserProfileID, usersDataObject.PhotoExtension, 100, 100, usersDataObject.OwnerName, usersDataObject.ModuleTypeID, usersDataObject.CategoryID);
                    ancor.HRef        = UsersDataFactory.GetUserPhotoBigThumbnail(usersDataObject.UserProfileID, usersDataObject.PhotoExtension, usersDataObject.OwnerName, usersDataObject.ModuleTypeID, usersDataObject.CategoryID);
                    //imgPhoto.AlternateText = itemsObject.Title;
                }
                else
                {
                    trPhotoPreview.Visible = false;
                }
                //------------------------------------------
                //------------------------------------------
                #endregion
                //------------------------------------------------------------
                if (currentModule.HasAgeRang)
                {
                    ddlAgeRang.SelectedValue = usersDataObject.AgeRang.ToString();
                }
                //----------------------------------------------------------------------
                if (currentModule.HasGender)
                {
                    ddlGender.SelectedValue = ((int)usersDataObject.Gender).ToString();
                }
                //----------------------------------------------------------------------
                if (currentModule.HasBirthDate)
                {
                    ucDateBirthDate.Date = Convert.ToDateTime(usersDataObject.BirthDate);
                }
                //----------------------------------------------------------------------
                if (currentModule.HasSocialStatus)
                {
                    ddlSocialStatus.SelectedValue = usersDataObject.SocialStatus.ToString();
                }
                //----------------------------------------------------------------------
                if (currentModule.HasEducationLevel)
                {
                    ddlEducationLevel.SelectedValue = usersDataObject.EducationLevel.ToString();
                }
                //----------------------------------------------------------------------
                if (currentModule.HasCountryID)
                {
                    ddlSystemCountries.SelectedValue = usersDataObject.CountryID.ToString();
                }
                //----------------------------------------------------------------------
                if (currentModule.HasCityID)
                {
                    ddlCities.SelectedValue = usersDataObject.CityID.ToString();
                }
                //------------------------------------------------------------
                if (currentModule.HasUserCityName)
                {
                    txtUserCityName.Text = usersDataObject.UserCityName.ToString();
                }
                //----------------------------------------------------------------------
                if (currentModule.HasTel)
                {
                    txtTel.Text = usersDataObject.Tel;
                }
                //----------------------------------------------------------------------
                if (currentModule.HasMobile)
                {
                    txtMobile.Text = usersDataObject.Mobile;
                }
                //----------------------------------------------------------------------
                if (currentModule.HasHasSmsService)
                {
                    cbHasSmsService.Checked = usersDataObject.HasSmsService;
                }
                //----------------------------------------------------------------------
                if (currentModule.HasHasEmailService)
                {
                    cbHasEmailService.Checked = usersDataObject.HasEmailService;
                }
                //------------------------------------------------------------
                if (currentModule.HasFax)
                {
                    txtFax.Text = usersDataObject.Fax;
                }
                //----------------------------------------------------------------------
                if (currentModule.HasMailBox)
                {
                    txtMailBox.Text = usersDataObject.MailBox;
                }
                //----------------------------------------------------------------------
                if (currentModule.HasZipCode)
                {
                    txtZipCode.Text = usersDataObject.ZipCode;
                }
                //----------------------------------------------------------------------
                if (currentModule.HasJobID)
                {
                    txtJobID.Text = usersDataObject.JobID.ToString();
                }
                //----------------------------------------------------------------------
                if (currentModule.HasJobText)
                {
                    txtJobText.Text = usersDataObject.JobText;
                }
                //----------------------------------------------------------------------
                if (currentModule.HasUrl)
                {
                    txtUrl.Text = usersDataObject.Url;
                }
                //----------------------------------------------------------------------
                if (currentModule.HasCompany)
                {
                    txtCompany.Text = usersDataObject.Company;
                }
                //----------------------------------------------------------------------
                if (currentModule.HasActivitiesID)
                {
                    ddlActivitiesID.SelectedValue = usersDataObject.ActivitiesID.ToString();
                }
                //----------------------------------------------------------------------
                //*--------------------------------------------------------

                txtDetails.Text = usersDataObject.ExtraData;
                //*--------------------------------------------------------
                //----------------------------------------------------------------------
                txtMetaKeyWordsAr.Text     = usersDataObject.KeyWordsAr;
                txtShortDescriptionAr.Text = usersDataObject.ShortDescriptionAr;
                //----------------------------------------------------------------------
                //----------------------------------------------------------------------
                //IsConsultant
                //-------------------------
                cbIsConsultant.Checked = Roles.IsUserInRole(usersDataObject.UserName, DCRoles.ConsultantsRoles);
                //----------------------------------------------------------------------
            }
            else
            {
                //Response.Redirect("default.aspx");
                Response.Redirect("../" + currentModule.Identifire + "/default.aspx");
            }
        }
    }