Example #1
0
 public SubControlMobileStoreFrontStoreInfo(DataRow paSubscriberInfo)
 {
     if (paSubscriberInfo != null)
     {
         clSubscriberRow = new SubscriberRow(paSubscriberInfo);
     }
 }
Example #2
0
        protected override ExecuteState Execute(ITodoHost host, DateTime utcBatchNow)
        {
            try
            {
                SubscriberVolumeRow minCntVol;
                var existing = FindSubscriber(out minCntVol);
                if (existing != null)
                {
                    return(ExecuteState.Complete);
                }
                if (minCntVol == null)
                {
                    minCntVol = createVolume();
                }

                var row = new SubscriberRow()
                {
                    G_SubscriberVolume = minCntVol.G_SubscriberVolume,
                    G_Subscriber       = G_Subscriber,
                    Subs_Type          = Subs_Type,
                    Create_Date        = App.TimeSource.UTCNow,
                    Parameters         = Parameters
                };

                try
                {
                    ForNode(row.G_SubscriberVolume).Insert(row);
                }
                catch (DataAccessException dae)
                {
                    if (dae.KeyViolation.IsNotNullOrWhiteSpace())
                    {
                        return(ExecuteState.Complete);
                    }
                    throw;
                }

                try
                {
                    minCntVol.Count++;
                    ForNode(G_Owner).Update(minCntVol, filter: "Count".OnlyTheseFields());
                }
                catch (Exception error)
                {
                    host.Log(MessageType.Error, this, "Subscribe()", error.ToMessageWithType(), error);
                }


                return(ExecuteState.Complete);
            }
            catch (Exception error)
            {
                host.Log(MessageType.Error, this, "Subscribe()", error.ToMessageWithType(), error);
                return(ExecuteState.ReexecuteAfterError);
            }
        }
Example #3
0
        protected virtual SubscriberRow FindSubscriber(out SubscriberVolumeRow minCntVol)
        {
            minCntVol = null;
            IEnumerable <SubscriberVolumeRow> volumes = GetSubscriberVolumes();
            SubscriberRow result = null;
            var           i      = 0;

            foreach (var volume in volumes)
            {
                var qry = Queries.FindSubscriber <SubscriberRow>(volume, G_Subscriber);
                if (result == null)
                {
                    result = ForNode(volume.G_SubscriberVolume).LoadRow(qry);
                }
                if ((volume.Count < SocialConsts.GetVolumeMaxCountForPosition(i++)) && (minCntVol == null || minCntVol.Count > volume.Count))
                {
                    minCntVol = volume;
                }
            }
            return(result);
        }
Example #4
0
 public WidControlFEBasicStoreLocation()
 {
     clSubscriberRow = RetrieveRow();
 }
Example #5
0
 public WidControlPOSUpdateSubscriberInfo()
 {
     clLanguageManager = ApplicationFrame.GetInstance().ActiveSubscription.ActiveLanguage;
     clSettingManager  = ApplicationFrame.GetInstance().ActiveSubscription.ActiveSetting;
     clSubscriberRow   = RetrieveRow();
 }
Example #6
0
 public void RemoveSubscriberRow(SubscriberRow row) {
     this.Rows.Remove(row);
 }
Example #7
0
 public void AddSubscriberRow(SubscriberRow row) {
     this.Rows.Add(row);
 }
Example #8
0
 public SubscriberRowChangeEvent(SubscriberRow row, global::System.Data.DataRowAction action) {
     this.eventRow = row;
     this.eventAction = action;
 }
Example #9
0
 public TokenRow AddTokenRow(SubscriberRow parentSubscriberRowByFK_Subscriber_Token, System.DateTime PublishedDate, string Body) {
     TokenRow rowTokenRow = ((TokenRow)(this.NewRow()));
     object[] columnValuesArray = new object[] {
             null,
             null,
             PublishedDate,
             Body};
     if ((parentSubscriberRowByFK_Subscriber_Token != null)) {
         columnValuesArray[1] = parentSubscriberRowByFK_Subscriber_Token[0];
     }
     rowTokenRow.ItemArray = columnValuesArray;
     this.Rows.Add(rowTokenRow);
     return rowTokenRow;
 }
Example #10
0
 public APNsRow AddAPNsRow(SubscriberRow parentSubscriberRowByFK_Subscriber_APNs, string DeviceToken, bool Failed, int UnreadRelease, bool Invalid) {
     APNsRow rowAPNsRow = ((APNsRow)(this.NewRow()));
     object[] columnValuesArray = new object[] {
             null,
             null,
             DeviceToken,
             Failed,
             UnreadRelease,
             Invalid};
     if ((parentSubscriberRowByFK_Subscriber_APNs != null)) {
         columnValuesArray[1] = parentSubscriberRowByFK_Subscriber_APNs[0];
     }
     rowAPNsRow.ItemArray = columnValuesArray;
     this.Rows.Add(rowAPNsRow);
     return rowAPNsRow;
 }