예제 #1
0
        public bool CreateFBUser(UserBase retUserBase, string firstName, string lastName)
        {
            if (retUserBase.UniqueID == 0)
            {
                return(false);
            }

            retUserBase.FBUser           = true;
            retUserBase.FirstName        = firstName;
            retUserBase.LastName         = lastName;
            retUserBase.Location.Country = ECountry.eCountryNULL;
            retUserBase.Gender           = EGender.eGenderNull;

            try
            {
                mUserBaseBO.Save(retUserBase);
            }
            catch (Exception)
            {
                retUserBase = null;
                return(false);
            }

            return(true);
        }
    public string CreateNewEvent(string topic, string description,
                                 string startDate, string startTime, string finishDate, string finishTime,
                                 string value, string isPublic)
    {
        if (!mIsInit)
        {
            InitMembers();
        }

        if (mCurrentUser == null)
        {
            return("User is not Loaded");
        }

        string    timeText = "";
        string    dateText = "";
        EventBase newEvent = new EventBase();
        DateTime  today    = DateTime.Today;

        newEvent.Admin = mCurrentUser;
        newEvent.ResourceDescription.Topic   = topic;
        newEvent.ResourceDescription.Summary = description;
        newEvent.Value    = int.Parse(value);
        newEvent.IsPublic = (isPublic == "1") ? true : false;

        timeText = startTime;
        dateText = startDate;
        if (dateText == string.Empty)
        {
            dateText = today.ToString("d-MMM-yyyy", CultureInfo.CreateSpecificCulture("en-US"));
        }
        newEvent.EventTimeInfo.BecomeActive = CommonStaticFunctions.ParseDateTime(dateText, timeText);

        timeText = finishTime;
        dateText = finishDate;
        if (dateText == string.Empty)
        {
            dateText = today.ToString("d-MMM-yyyy", CultureInfo.CreateSpecificCulture("en-US"));
        }
        newEvent.EventTimeInfo.BecomeInactive = CommonStaticFunctions.ParseDateTime(dateText, timeText);

        mEventBaseBO.Save(newEvent);

        mCurrentUser.Events.Add(newEvent);

        mUserBaseBO.Save(mCurrentUser);

        Session["CurrentUser"] = mCurrentUser;

        Session["CurrentEvent"] = newEvent;

        return("Success");
    }
예제 #3
0
    public string UpdateUser(string email, string password, string firstName, string lastName, string gender, string country)
    {
        mCurrentUser = (UserBase)Session["CurrentUser"];

        if (mCurrentUser == null)
        {
            return("Please Reload Page");
        }

        UserBaseBO userBaseBO = new UserBaseBO();

        ECountry eCountry = (ECountry)Int32.Parse(country.Substring(("ECountry_").Length));
        EGender  eGender  = (EGender)Int32.Parse(gender.Substring(("EGender_").Length));

        mCurrentUser.Email     = email;
        mCurrentUser.FirstName = firstName;
        mCurrentUser.LastName  = lastName;
        mCurrentUser.Gender    = eGender;

        if (!mCurrentUser.Location.IsLoaded())
        {
            ObjectLocationBO objectLocationBO = new ObjectLocationBO();
            objectLocationBO.Load(mCurrentUser.Location);
        }

        mCurrentUser.Location.Country = eCountry;

        userBaseBO.Save(mCurrentUser);

        LoginManagerBO loginManagerBO = new LoginManagerBO();

        if (password.Length < 6)
        {
            loginManagerBO.UpdateUserLoginInfo(mCurrentUser.UniqueID, email);
        }
        else
        {
            loginManagerBO.UpdateUserLoginInfo(mCurrentUser.UniqueID, email, password);
        }

        Session["CurrentUser"] = mCurrentUser;

        return("Success");
    }