示例#1
0
 public void send_updateContactSetting(int reqSeq, string mid, ContactSetting flag, string value)
 #endif
 {
   oprot_.WriteMessageBegin(new TMessage("updateContactSetting", TMessageType.Call, seqid_));
   updateContactSetting_args args = new updateContactSetting_args();
   args.ReqSeq = reqSeq;
   args.Mid = mid;
   args.Flag = flag;
   args.Value = value;
   args.Write(oprot_);
   oprot_.WriteMessageEnd();
   #if SILVERLIGHT
   return oprot_.Transport.BeginFlush(callback, state);
   #else
   oprot_.Transport.Flush();
   #endif
 }
示例#2
0
      public void updateContactSetting(int reqSeq, string mid, ContactSetting flag, string value)
      {
        #if !SILVERLIGHT
        send_updateContactSetting(reqSeq, mid, flag, value);
        recv_updateContactSetting();

        #else
        var asyncResult = Begin_updateContactSetting(null, null, reqSeq, mid, flag, value);
        End_updateContactSetting(asyncResult);

        #endif
      }
示例#3
0
 public IAsyncResult send_updateContactSetting(AsyncCallback callback, object state, int reqSeq, string mid, ContactSetting flag, string value)
示例#4
0
 public IAsyncResult Begin_updateContactSetting(AsyncCallback callback, object state, int reqSeq, string mid, ContactSetting flag, string value)
 {
   return send_updateContactSetting(callback, state, reqSeq, mid, flag, value);
 }
示例#5
0
 public void AddConnection(int agent1Id, int agent2Id, ContactSetting setting)
 {
     _contactGraph.ConnectAgents(agent1Id, agent2Id, new { Setting = setting });
 }
示例#6
0
 public void AddConnection(Human agent1, Human agent2, ContactSetting setting)
 {
     AddConnection(agent1.Id, agent2.Id, setting);
 }
示例#7
0
        private void Save()
        {
            Contact contact       = BLL.CurrentContact;
            bool    showSmsCols   = BLL.Mandator.SmsNotifications;
            bool    showEmailCols = BLL.Mandator.OnNewEventNotifyContacts ||
                                    BLL.Mandator.OnEditEventNotifyContacts ||
                                    BLL.Mandator.OnNewSubscriptionNotifyContacts ||
                                    BLL.Mandator.OnEditSubscriptionNotifyContacts ||
                                    BLL.Mandator.OnDeleteSubscriptionNotifyContacts;

            string emailBefore = contact.Email;

            try
            {
                contact.Name           = Name.Text;
                contact.Email          = Email.Text;
                contact.MobilePhone    = MobilePhone.Text;
                contact.LiftMgmtSmsOn  = LiftMgmtSmsOn.Checked;
                contact.EventMgmtSmsOn = EventMgmtSmsOn.Checked;

                foreach (EventCategory category in BLL.ListEventCategories())
                {
                    ContactSetting setting          = EventSiteBL.GetContactSetting(contact, category);
                    Hashtable      categoryControls = (Hashtable)ViewState[String.Format("ES_CategoryControls_{0}", category.EventCategoryId)];

                    //check if contactsettings have changed --> if not changed set id to 0 to ignore saving this item
                    bool   notifByEmail = false, notifBySms = false, notifSubscr = false;
                    NInt32 autoNotifSubscr = new NInt32(0, true);
                    if (showEmailCols)
                    {
                        notifByEmail = EvaluateCheckBox(Request.Form[(string)categoryControls[String.Format("chkNotifyByEmail_{0}", category.EventCategoryId)]]);
                    }
                    if (showSmsCols)
                    {
                        notifBySms      = EvaluateCheckBox(Request.Form[(string)categoryControls[String.Format("chkNotifyBySms_{0}", category.EventCategoryId)]]);
                        notifSubscr     = EvaluateCheckBox(Request.Form[(string)categoryControls[String.Format("chkSmsNotifSubscription_{0}", category.EventCategoryId)]]);
                        autoNotifSubscr = EvaluateNInt32TextBox(Request.Form[(string)categoryControls[String.Format("tbAutoNotifSubscription_{0}", category.EventCategoryId)]]);
                    }

                    if (showEmailCols && setting.NotifyByEmail != notifByEmail ||
                        showSmsCols && (setting.NotifyBySms != notifBySms ||
                                        setting.SmsNotifSubscriptionsOn != notifSubscr ||
                                        setting.AutoNotifSubscription.IsNull != autoNotifSubscr.IsNull ||
                                        !setting.AutoNotifSubscription.IsNull && setting.AutoNotifSubscription != autoNotifSubscr))
                    {
                        if (showEmailCols)
                        {
                            setting.NotifyByEmail = notifByEmail;
                        }
                        if (showSmsCols)
                        {
                            setting.NotifyBySms             = notifBySms;
                            setting.SmsNotifSubscriptionsOn = notifSubscr;
                            setting.AutoNotifSubscription   = autoNotifSubscr;
                        }
                    }
                    else
                    {
                        setting.ContactSettingId = 0;
                    }
                    //set NotifyBySms in any case, for validation if mobilephone is empty
                    setting.NotifyBySms = notifBySms;
                }
            }
            catch (EventSiteException ex)
            {
                RegisterStartupScriptIfNeeded("invalContactData", ex.JavaScriptAlertString);
                BLL.RenewCurrentContact();
                FillFieldValues();
                return;
            }

            BLL.EditContact(contact);
            BLL.SaveContactSettings(contact);

            if (!contact.Email.Equals(emailBefore))
            {
                //current contact's email has changed --> signout after update
                string signoutScript = string.Format(pbHelpers.JavaScriptString, @"
	alert('Da die eigene Email-Adresse geändert wurde, musst Du dich neu anmelden.');
	document.getElementById('"     + LogoutButton.ClientID + @"').click();
");
                RegisterStartupScriptIfNeeded("signoutScript", signoutScript);

                return;
            }
            else
            {
                RegisterStartupScriptIfNeeded("saveSuccess", String.Format(playboater.gallery.commons.Helpers.JavaScriptAlertString, "Einstellungen erfolgreich gespeichert."));
                BLL.RenewCurrentContact();
            }

            FillFieldValues();
        }
示例#8
0
 public ContactEdge(int sourceId, int targetId, ContactSetting setting) : base(sourceId, targetId)
 {
     ContactSetting = setting;
 }