示例#1
0
 /*
  * confirmation of modification
  */
 public void edit()
 {
     if (!mail.Equals(tmpmail) && VMLogIn.IsValidEmail(tmpmail))
     {
         _Server.SetInfoUser(this._name, "email", this.tmpmail);
     }
     if (!firstName.Equals(tmpfirstName))
     {
         _Server.SetInfoUser(this._name, "name", this.tmpfirstName);
     }
     if (!surName.Equals(tmpsurName))
     {
         _Server.SetInfoUser(this._name, "givenname", this.tmpsurName);
     }
     if (!birth.Equals(tmpbirth) && VMLogIn.IsValidDate(tmpbirth))
     {
         _Server.SetInfoUser(this._name, "birthday", this.tmpbirth);
     }
     if (!location.Equals(tmplocation))
     {
         _Server.SetInfoUser(this._name, "location", this.tmplocation);
     }
     if (!phone.Equals(tmpphone))
     {
         _Server.SetInfoUser(this._name, "telephone", this.tmpphone);
     }
     if (!gender.Equals(tmpgender) && VMLogIn.IsValidGender(tmpgender))
     {
         _Server.SetInfoUser(this._name, "gender", this.tmpgender);
     }
     _Server.GetInfoUser(this._name);
 }
 private void createEvent(object param)
 {
     if (!eventName.Equals(String.Empty) && VMLogIn.IsValidDate(eventDate) &&
         !eventLocation.Equals(String.Empty) && !eventContent.Equals(String.Empty))
     {
         _Server.CreateEvent(_creatorName, eventName, _creatorEmail, eventContent, eventDate, eventLocation);
     }
     else
     {
         errMess = "Error: No optional field.\nDate should be formated like dd/MM/yyyy or dd-MM-yyyy...";
     }
 }
示例#3
0
 private void ask(object param)
 {
     if (VMLogIn.IsValidName(entry))
     {
         if (frORbl)
         {
             _Server.addFriend(name, entry);
         }
         else
         {
             _Server.addToBlackList(name, entry);
         }
     }
 }
示例#4
0
        void Initialize(String message)
        {
            VMLogIn login = new VMLogIn(_Server);
            login.message = message;
            VMInnerBoard innerBoard = new VMInnerBoard(_Server);

            login.moveTo += new EventHandler<MoveToEventArgs>(Switcher_moveTo);
            innerBoard.moveTo += new EventHandler<MoveToEventArgs>(Switcher_moveTo);

            ViewModels = new ObservableCollection<ViewModelBase>()
            {
                login,
                innerBoard
            };
            ViewModelView = CollectionViewSource.GetDefaultView(ViewModels);
        }
示例#5
0
        void Initialize(String message)
        {
            VMLogIn login = new VMLogIn(_Server);

            login.message = message;
            VMInnerBoard innerBoard = new VMInnerBoard(_Server);

            login.moveTo      += new EventHandler <MoveToEventArgs>(Switcher_moveTo);
            innerBoard.moveTo += new EventHandler <MoveToEventArgs>(Switcher_moveTo);

            ViewModels = new ObservableCollection <ViewModelBase>()
            {
                login,
                innerBoard
            };
            ViewModelView = CollectionViewSource.GetDefaultView(ViewModels);
        }
示例#6
0
 /// <summary>
 /// edit an existing event
 /// </summary>
 /// <param name="param"></param>
 private void editEvent(object param)
 {
     if (!eventName.Equals(String.Empty) && VMLogIn.IsValidDate(eventDate) &&
         !eventLocation.Equals(String.Empty) && !eventContent.Equals(String.Empty))
     {
         if (!_deepEventLocation.Equals(eventLocation))
         {
             _Server.UpdateEvent(_deepEventName, "location", eventLocation);
         }
         if (!_deepEventDate.Equals(eventDate))
         {
             _Server.UpdateEvent(_deepEventName, "date", eventDate);
         }
         if (!_deepEventContent.Equals(eventContent))
         {
             _Server.UpdateEvent(_deepEventName, "description", eventContent);
         }
     }
     else
     {
         errMess = "Error: No optional field.\nDate should be formated like dd/MM/yyyy or dd-MM-yyyy...";
     }
 }