Example #1
0
        public void showProfile(long userID)
        {
            try
            {
                VMukti.Business.clsProfileCollection objProfile = VMukti.Business.clsProfileCollection.GetUserProfile(int.Parse(userID.ToString()));
                if (objProfile.Count != 0 && objProfile != null)
                {
                    txtUserID.Text   = VMukti.Business.clsProfile.GetUserDisplayName(int.Parse(userID.ToString()));
                    txtFullName.Text = objProfile[0].FullName;
                    txtEmail.Text    = objProfile[0].Email;

                    txtCountry.Text  = objProfile[0].Country;
                    txtState.Text    = objProfile[0].State;
                    txtCity.Text     = objProfile[0].City;
                    txtTimezone.Text = objProfile[0].Timezone;
                    txtLanguage.Text = objProfile[0].Language;
                    txtGender.Text   = objProfile[0].Gender;

                    DateTime birthdate = objProfile[0].BirthDate;
                    if (birthdate.Day.ToString().Equals("1") && birthdate.Month.ToString().Equals("1") && birthdate.Year.ToString().Equals("1753"))
                    {
                        txtBirthdate.Text = "";
                    }
                    else
                    {
                        txtBirthdate.Text = birthdate.Month.ToString() + "/" + birthdate.Day.ToString() + "/" + birthdate.Year.ToString() + "\t (MM/DD/YYYY)";
                    }

                    txtHomePage.Text    = objProfile[0].HomePage;
                    txtAboutMe.Text     = objProfile[0].AboutMe;
                    txtHomePhone.Text   = objProfile[0].HomePhone;
                    txtOfficePhone.Text = objProfile[0].OfficePhone;
                    txtMobilePhone.Text = objProfile[0].MobilePhone;
                }
                else
                {
                    txtUserID.Text   = VMukti.Business.clsProfile.GetUserDisplayName(int.Parse(userID.ToString()));
                    txtFullName.Text = "";
                    txtEmail.Text    = VMukti.Business.clsProfile.GetUserEmail(int.Parse(userID.ToString()));

                    txtCountry.Text     = "";
                    txtState.Text       = "";
                    txtCity.Text        = "";
                    txtTimezone.Text    = "";
                    txtLanguage.Text    = "";
                    txtGender.Text      = "";
                    txtBirthdate.Text   = "";
                    txtHomePage.Text    = "";
                    txtAboutMe.Text     = "";
                    txtHomePhone.Text   = "";
                    txtOfficePhone.Text = "";
                    txtMobilePhone.Text = "";
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "showProfile()", "Controls\\CtlViewProfile.xaml.cs");
            }
        }
Example #2
0
        public void LoadMyProfile()
        {
            try
            {
                txtAboutMe.SelectAll();
                txtAboutMe.Selection.Text = "";
                VMukti.Business.clsProfileCollection objMyProfile = VMukti.Business.clsProfileCollection.GetUserProfile(VMuktiAPI.VMuktiInfo.CurrentPeer.ID);
                if (objMyProfile.Count != 0 && objMyProfile != null)
                {
                    txtFullName.Text = objMyProfile[0].FullName;
                    txtEmail.Text    = objMyProfile[0].Email;
                    ComboBoxItem cbi;
                    cbi         = new ComboBoxItem();
                    cbi.Content = objMyProfile[0].Country;
                    cbi.ToolTip = objMyProfile[0].Country;


                    cmbCountry.Text = objMyProfile[0].Country;

                    txtState.Text = objMyProfile[0].State;
                    txtCity.Text  = objMyProfile[0].City;

                    cbi.Content      = objMyProfile[0].Timezone;
                    cbi.ToolTip      = objMyProfile[0].Timezone;
                    cmbTimezone.Text = cbi.Content.ToString();

                    cbi.Content      = objMyProfile[0].Language;
                    cbi.ToolTip      = objMyProfile[0].Language;
                    cmbLanguage.Text = cbi.Content.ToString();

                    cbi.Content    = objMyProfile[0].Gender;
                    cbi.ToolTip    = objMyProfile[0].Gender;
                    cmbGender.Text = cbi.Content.ToString();

                    DateTime birthdate = objMyProfile[0].BirthDate;
                    if (birthdate.Day.ToString().Equals("1") && birthdate.Month.ToString().Equals("1") && birthdate.Year.ToString().Equals("1"))
                    {
                        cbi.Content    = "-";
                        cbi.ToolTip    = "-";
                        cmbBDay.Text   = cbi.Content.ToString();
                        cbi.Content    = "-";
                        cbi.ToolTip    = "-";
                        cmbBMonth.Text = cbi.Content.ToString();
                        cbi.Content    = "-";
                        cbi.ToolTip    = "-";
                        cmbBYear.Text  = cbi.Content.ToString();
                    }
                    else
                    {
                        cbi.Content    = birthdate.Day.ToString();
                        cbi.ToolTip    = birthdate.Day.ToString();
                        cmbBDay.Text   = cbi.Content.ToString();
                        cbi.Content    = birthdate.Month.ToString();
                        cbi.ToolTip    = birthdate.Month.ToString();
                        cmbBMonth.Text = cbi.Content.ToString();
                        cbi.Content    = birthdate.Year.ToString();
                        cbi.ToolTip    = birthdate.Year.ToString();
                        cmbBYear.Text  = cbi.Content.ToString();
                    }
                    txtHomePage.Text = objMyProfile[0].HomePage;
                    txtAboutMe.AppendText(objMyProfile[0].AboutMe);

                    txtHomePhone.Text   = objMyProfile[0].HomePhone;
                    txtOfficePhone.Text = objMyProfile[0].OfficePhone;
                    txtMobilePhone.Text = objMyProfile[0].MobilePhone;
                }
                else
                {
                    txtCity.Text              = "";
                    txtFullName.Text          = "";
                    txtState.Text             = "";
                    txtOfficePhone.Text       = "";
                    txtMobilePhone.Text       = "";
                    txtHomePhone.Text         = "";
                    txtHomePage.Text          = "http://";
                    cmbBDay.SelectedIndex     = 0;
                    cmbBMonth.SelectedIndex   = 0;
                    cmbBYear.SelectedIndex    = 0;
                    cmbCountry.SelectedIndex  = 0;
                    cmbGender.SelectedIndex   = 0;
                    cmbLanguage.SelectedIndex = 0;
                    cmbTimezone.SelectedIndex = 0;
                    txtAboutMe.Document.Blocks.Clear();
                    txtEmail.Text = VMukti.Business.clsProfile.GetUserEmail(VMuktiAPI.VMuktiInfo.CurrentPeer.ID);
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "LoadMyProfile()", "Controls\\CtlProfile.xaml.cs");
            }
        }