コード例 #1
0
ファイル: IBESettings.cs プロジェクト: Duke-Jones/ED-IBE
 protected virtual void OnDataChanged(DataChangedEventArgs e)
 {
     EventHandler<DataChangedEventArgs> myEvent = DataChanged;
     if (myEvent != null)
     {
         myEvent(this, e);
     }
 }
コード例 #2
0
        /// <summary>
        /// 表单中数据改变的时候消息处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected override void OnXapFormControl_DataChanged(object sender, DataChangedEventArgs e)
        {
            #region 变动用药属性改变
            if (e.PropName.ToLower() == "fg_dose_anoma")
            {
                EmsUIDTO uiEmsDTO = (this.GetViewModel().GetEmsUIDTO() as EmsUIDTO);

                if (Boolean.Parse(e.Input.ToString()))
                {
                    if (uiEmsDTO.Emsdrugs.EmsOrDoseDrug.Count == 0)
                    {
                        uiEmsDTO.Emsdrugs.EmsOrDoseDrug =
                            this.GetLogicEx().GetFreqVsTimes(uiEmsDTO.Emsdrugs.Id_freq,
                                                             uiEmsDTO.Emsdrugs.Id_orsrv,
                                                             uiEmsDTO.Emsdrugs.Id_or);
                    }

                    var dlg = new DoseChangedDrugsDialog(uiEmsDTO.Emsdrugs.EmsOrDoseDrug);

                    dlg.SaveEvent   += dlg_SaveEvent;
                    dlg.CancelEvent += dlg_SaveEvent;



                    uiEmsDTO.Emsdrugs.EmsOrDoseDrug.ToList().ForEach(p =>
                    {
                        p.Quan_med      = uiEmsDTO.Emsdrugs.Quan_med;//剂量
                        p.Name_unit_med = uiEmsDTO.Emsdrugs.Name_unit_med;

                        p.Id_unit_med = uiEmsDTO.Emsdrugs.Id_unit_med;
                    });

                    dlg.ShowDialog();
                }
                else
                {
                    uiEmsDTO.Emsdrugs.EmsOrDoseDrug.Clear();
                }
            }
            #endregion
            if (e.Input != null)
            {
                orSrvInfoChanged(e.PropName.ToLower(), e.Input.ToString());
            }
            if (e.PropName.ToLower() == "fg_mp_in" || e.PropName.ToLower() == "times_mp_in" || e.PropName.ToLower() == "fg_treat" || e.PropName.ToLower() == "fg_selfpay")
            {
                this.SentNotify(EventCodeType.NM_EMS_ORSRV_DATACHANGED);
            }
            if (e.PropName.ToLower() == "name_routedes")
            {
                if (!(this.GetViewModel() as EmsDrugsViewModel).bEdit_Note_or)
                {
                    this.GetLogicEx().SetNoteOr(this.GetViewModel().GetEmsUIDTO() as EmsUIDTO);
                }
            }
        }
コード例 #3
0
ファイル: frmMonitor2.cs プロジェクト: qq5013/ChangSu
        void CarServer_OnDataChanged(object sender, DataChangedEventArgs e)
        {
            try
            {
                if (e.State == null)
                {
                    return;
                }

                PLC    plc = new PLC();
                string txt = e.ItemName.Split('_')[0];
                plc.ID      = txt;
                plc.PicName = "picCar";

                if (e.ItemName.IndexOf("TaskNo") >= 0)
                {
                    plc.Text     = Util.ConvertStringChar.BytesToString(e.States);
                    plc.TextName = "txtCarTaskNo";
                }
                else if (e.ItemName.IndexOf("PalletCode") >= 0)
                {
                    plc.Text     = Util.ConvertStringChar.BytesToString(e.States);
                    plc.TextName = "txtPalletCode";
                }
                else if (e.ItemName.IndexOf("HasProduct") >= 0) //图片
                {
                    if ((bool)e.State)
                    {
                        plc.ShowPic = "1";
                    }
                }
                else
                {
                    string strErrorNo = Util.ConvertStringChar.BytesToString(e.States);
                    if (strErrorNo != "0" && strErrorNo != "32" && strErrorNo.Length != 0)
                    {
                        plc.Text     = dicCarError[strErrorNo];
                        plc.TextName = "txtCarErrorDesc";
                        plc.IsErr    = "1";
                        plc.ErrCode  = strErrorNo;
                        plc.ShowPic  = "1";
                    }
                    else
                    {
                        plc.Text     = "";
                        plc.IsErr    = "0";
                        plc.TextName = "txtCarErrorDesc";
                    }
                }
                PLCS.PLCInfo(plc);
            }
            catch (Exception ex)
            {
                MCP.Logger.Error("监控界面中CarServer_OnDataChanged出现异常" + ex.Message);
            }
        }
コード例 #4
0
        /// <summary> Occurs when the Metadata.DataProvider.Data has been changed
        /// </summary>
        /// <param name="e"></param>
        protected virtual void OnDataChanged(DataChangedEventArgs e)
        {
//			//TODO Verify
//			//StackOverflow!
////			Debug.WriteLine("=>INFO: Recursive notify DataProvider.Data has been changed. UniqueID: {8CAA2DBC-2AC0-4846-800F-7805148B7456}");
//			foreach (var businessObject in Children) {
//			    //if(ObjectBM is IListBM) ObjectBM.Metadata.DataProvider.NotifyDataChanged();
//			    businessObject.Metadata.DataProvider.NotifyDataChanged();
//			}
        }
コード例 #5
0
 public void AddData(double value)
 {
     data.Add(new DateTimeData(DateTime.Now, value));
     DataChanged?.Invoke(this, DataChangedEventArgs.Add());
     if (data.Count > MaxDataCount)
     {
         data.RemoveAt(0);
         DataChanged?.Invoke(this, DataChangedEventArgs.Remove(0));
     }
 }
コード例 #6
0
 /// <summary>
 /// 編集中のデータが変更されたときに発生するイベントを中継します。
 /// </summary>
 private void dataChangedRelay(object sender, DataChangedEventArgs e)
 {
     if (this.EdittingData != null)
     {
         this.EdittingData.IsDirty = true;
         this.PushData(this.MyDB.Rows[this.EdittingIndex], this.EdittingIndex);
     }
     this.DataChangedEx?.Invoke(sender, e);
     this.OnEditted();
 }
コード例 #7
0
        public override void DataChanged(DataChangedEventArgs e)
        {
            string a;

            if ((a = e.Field.Key.ToUpperInvariant()) != null && a == "FSALEORGLIST")
            {
                this.selOrgId = e.NewValue.ToString();
            }
            base.DataChanged(e);
        }
コード例 #8
0
 /*
  * Метод-обработчик события DataNotChanged
  * если это не первое измения данных ,то вызывает метод MoveShapes
  */
 private void OnDataChanged(DataChangedEventArgs e)
 {
     DataForFirstMove = e.NewData;
     curShapeData     = e.OldData;
     newShapeData     = e.NewData;
     if (isNoFirstShapesMoving)
     {
         MoveShapes();
     }
 }
コード例 #9
0
ファイル: MainForm.cs プロジェクト: Hendrik410/KKS_Drone
        private void Drone_OnDataChange(object sender, DataChangedEventArgs eventArgs)
        {
            if (InvokeRequired)
            {
                Invoke(new EventHandler <DataChangedEventArgs>(Drone_OnDataChange), this, eventArgs);
                return;
            }

            UpdateData(eventArgs.Data);
        }
コード例 #10
0
        public override void DataChanged(DataChangedEventArgs e)
        {
            //DynamicObject oMaterial = this.View.Model.GetValue("F_PAEZ_Base", e.Row) as DynamicObject;
            DynamicObject oMaterial = this.View.Model.GetValue(e.Field.Key, e.Row) as DynamicObject;

            if (oMaterial != null)
            {
                string sMaterialName = Convert.ToString(oMaterial["Name"]);
            }

            DynamicObject oOldBase = e.OldValue as DynamicObject;
            string        s = this.Model.GetValue("FBillNo") + "";
            string        colType, tabNAme;
            string        oldValue, newValue;

            if (IsKeyColumn(e.Field + "", this.View.BillBusinessInfo.Elements[0].Name, out colType, out tabNAme))
            {
                foreach (var item in colist)
                {
                    if (item["Column"] == e.Field + "" && item["Row"] == e.Row + "")
                    {
                        colist.Remove(item);
                        break;
                    }
                }

                switch (colType)
                {
                case "基础资料":
                    IsTypeJCZL(e, tabNAme, out oldValue, out newValue);
                    break;

                case "辅助资料":
                    IsTypeFZZL(e, tabNAme, out oldValue, out newValue);
                    break;

                case "组织":
                    IsTypeZZ(e, tabNAme, out oldValue, out newValue);
                    break;

                case "用户":
                    IsTypeYH(e, tabNAme, out oldValue, out newValue);
                    break;

                case "默认":
                    break;
                }

                this.colist.Add(new Dictionary <string, string>()
                {
                    { "Column", e.Field + "" }, { "ColType", colType }, { "Row", e.Row + "" }, { "Old", e.OldValue + "" }, { "New", e.NewValue + "" }
                });
            }
            //DBServiceHelper.Execute(this.Context, "");
        }
コード例 #11
0
ファイル: frmMonitor.cs プロジェクト: baoyigang/ZKSA
        void Miniload_OnDataChanged(object sender, DataChangedEventArgs e)
        {
            try
            {
                if (e.State == null)
                {
                    return;
                }

                string miniloadNo = e.ServerName.Replace("MiniloadServer", "");
                GetMiniload(miniloadNo);
                if (e.ItemName.IndexOf("Mode") >= 0)
                {
                    dicMiniload[miniloadNo].Mode = int.Parse(e.State.ToString());
                }
                else if (e.ItemName.IndexOf("State1") >= 0)
                {
                    dicMiniload[miniloadNo].State1 = int.Parse(e.State.ToString());
                }
                else if (e.ItemName.IndexOf("Fork1") >= 0)
                {
                    dicMiniload[miniloadNo].Fork1 = int.Parse(e.State.ToString());
                }
                else if (e.ItemName.IndexOf("TaskNo1") >= 0)
                {
                    dicMiniload[miniloadNo].TaskNo1 = Util.ConvertStringChar.BytesToString(ObjectUtil.GetObjects(e.States));
                }
                else if (e.ItemName.IndexOf("State2") >= 0)
                {
                    dicMiniload[miniloadNo].State2 = int.Parse(e.State.ToString());
                }
                else if (e.ItemName.IndexOf("Fork2") >= 0)
                {
                    dicMiniload[miniloadNo].Fork2 = int.Parse(e.State.ToString());
                }
                else if (e.ItemName.IndexOf("TaskNo2") >= 0)
                {
                    dicMiniload[miniloadNo].TaskNo2 = Util.ConvertStringChar.BytesToString(ObjectUtil.GetObjects(e.States));
                }
                else if (e.ItemName.IndexOf("AlarmCode") >= 0)
                {
                    dicMiniload[miniloadNo].AlarmCode = int.Parse(e.State.ToString());
                }
                else if (e.ItemName.IndexOf("Station") >= 0)
                {
                    dicMiniload[miniloadNo].Station = e.States;
                }

                Miniloads.MiniloadInfo(dicMiniload[miniloadNo]);
            }
            catch (Exception ex)
            {
                MCP.Logger.Error("Miniload监控界面中Miniload_OnDataChanged出现异常" + ex.Message);
            }
        }
コード例 #12
0
ファイル: MainModel.cs プロジェクト: 1600593/eFinances
        public bool DeleteData(string ActionId, object[] parameters)
        {
            DataChangedEventArgs e = new DataChangedEventArgs
            {
                ActionId    = ActionId,
                ChangedData = parameters
            };

            OnDataChanged?.Invoke(this, e);
            return(true);
        }
コード例 #13
0
        /// <summary>
        /// 提醒打分超过权重
        /// </summary>
        private void Act_DC_WarnScoreOverWeight(DataChangedEventArgs e)
        {
            float FLWeight        = float.Parse(this.View.Model.GetValue("FLWeight", e.Row).ToString());
            float FLDirectorGrade = float.Parse(this.View.Model.GetValue("FLDirectorGrade", e.Row).ToString());

            if (FLDirectorGrade > FLWeight)
            {
                this.View.Model.SetValue("FLDirectorGrade", FLWeight, e.Row);
                this.View.ShowWarnningMessage("评分不能超过权重!");
            }
        }
コード例 #14
0
        protected override void DataChanged(Subscription subscription, DataChangedEventArgs args)
        {
            foreach (var change in args.DataChanges)
            {
                EventVqt @event = new EventVqt();
                @event.KSpiceFillWith((KSpiceVariableData)change.MonitoredItem.UserData, change);
                var package = new EventPackage(@event, _plantCode, Constants.RealTime, new List <string>());

                _outBuffer.Post(package);
            }
        }
コード例 #15
0
 private void OnPurseChanged(object sender, DataChangedEventArgs eventArgs)
 {
     if (eventArgs.FreshDataRequired)
     {
         _screen.RefreshContent();
     }
     else
     {
         _screen.DisplayContent(SelectAccounts(eventArgs.FreshDataRequired));
     }
 }
コード例 #16
0
ファイル: DemoZy003.cs プロジェクト: szzend/CLOUDDOC
        public override void DataChanged(DataChangedEventArgs e)
        {
            base.DataChanged(e);

            switch (e.Field.Key.ToLower())
            {
            case "f_pae_creator":
                this.View.ShowMessage(string.Format("修改前的值是:{0},修改后的值是:{1}", e.OldValue, e.NewValue));
                break;
            }
        }
コード例 #17
0
 public void TagRecordChangedEventHandler(object sender, DataChangedEventArgs args)
 {
     if (this.InvokeRequired)
     {
         BeginInvoke(new Action(() => OnPrimaryKeyChanged(EventArgs.Empty)));
     }
     else
     {
         OnPrimaryKeyChanged(EventArgs.Empty);
     }
 }
コード例 #18
0
 public override void DataChanged(DataChangedEventArgs e)
 {
     base.DataChanged(e);
     if (e.Field.Key.ToUpperInvariant().Equals("FASSETTYPEID"))
     {
         string assetNo = Convert.ToString(this.Model.GetValue("FASSETNO", 0));
         //this.Model.SetValue("FASSETNO",);
         string[] code = CardServiceHelper.GetAssetCodeByRule(base.Context, base.Model.DataObject, 1);
         this.Model.SetValue("FASSETNO", "1234", 0);
     }
 }
コード例 #19
0
 private void Handler(object sender, DataChangedEventArgs args)
 {
     Dispatcher.Invoke(() =>
     {
         lock (_displayLock)
         {
             TextStreamingResults.Text += Environment.NewLine;
             TextStreamingResults.Text += string.Format("{0} {1}: {2}", args.Event, args.Path,
                                                        args.Data ?? "<null>");
         }
     });
 }
コード例 #20
0
 /// <summary>
 /// 值更新
 /// </summary>
 /// <param name="e"></param>
 public override void DataChanged(DataChangedEventArgs e)
 {
     if (this.Context.ClientType.ToString() != "Mobile")
     {
         base.DataChanged(e);
         var _Names = GetApplySign();
         if (e.Field.Key.ToString().ToUpper() == _Names["FEmpID"].ToUpper())
         {
             SetApplyValueUpdate();
         }
     }
 }
コード例 #21
0
        public override void DataChanged(DataChangedEventArgs e)
        {
            base.DataChanged(e);
            string        key = e.Field.Key.ToUpperInvariant();
            DynamicObject BasicObject;

            //判断实收数量是否改变
            if ((key == "FREALQTY" && Convert.ToInt32(e.NewValue) > 0) || (key == "FSTOCKDEPTID" && Convert.ToInt32(e.NewValue) > 0))
            {
                //获取单据组织
                DynamicObject stockOrg = this.Model.GetValue("FSTOCKORGID") as DynamicObject;
                long          orgId    = Convert.ToInt64(stockOrg["Id"]);
                //获取单据部门(需要判断是否为工厂)
                DynamicObject stockDept   = this.Model.GetValue("FSTOCKDEPTID") as DynamicObject;
                long          stockDeptId = Convert.ToInt64(stockDept["Id"]);
                //sql 执行sql查询对应组织工厂成品库
                string sql    = string.Format(@" select t1.fstockId from t_bd_stock t1 
                                           inner join t_bd_stock_l t2 on t1.fstockid = t2.fstockid
                                           where t2.fname like '%工厂成品库%' and fuseorgid={0}", orgId);
                long   result = DBUtils.ExecuteScalar <long>(base.Context, sql, -1, null);
                if (result != -1 && result != 0)
                {
                    IMetaDataService metaService = ServiceHelper.GetService <IMetaDataService>();              //元数据服务
                    IViewService     view        = ServiceHelper.GetService <IViewService>();                  //界面服务
                    FormMetadata     Meta        = metaService.Load(base.Context, "BD_STOCK") as FormMetadata; //获取基础资料元数据
                    BasicObject = view.LoadSingle(base.Context, result, Meta.BusinessInfo.GetDynamicObjectType());
                    //sql2 执行sql查询 界面是否为工厂
                    string sql2 = string.Format(@" select t.fdeptid from t_bd_department_l t where t.fname like '%工厂%' ");
                    DynamicObjectCollection result2 = DBUtils.ExecuteDynamicObject(this.Context, sql2);
                    //遍历工厂
                    foreach (DynamicObject stock in result2)
                    {
                        if (stock["FDeptId"].Equals(stockDeptId))
                        {
                            int row = this.Model.GetEntryRowCount("FInStockEntry");
                            for (int i = 0; i < row; i++)
                            {
                                this.Model.SetValue("FStockId", BasicObject, i);
                            }
                            break;
                        }
                        if (!stock["FDeptId"].Equals(stockDeptId))
                        {
                            int row = this.Model.GetEntryRowCount("FInStockEntry");
                            for (int i = 0; i < row; i++)
                            {
                                this.Model.SetValue("FStockId", null, i);
                            }
                        }
                    }
                }
            }
        }
コード例 #22
0
ファイル: OrderApobsView.cs プロジェクト: fhis/order.client
 //OrSrvForm frm;
 //MmForm form;
 void xapFormControl1_DataChanged(object sender, DataChangedEventArgs e)
 {
     if (e.PropName.ToLower().Equals("fg_mp_bed"))
     {
         //判断表格是否可编辑.
         gv.ReadOnly = !(bool)e.Input;
     }
     else if (e.PropName.Equals("Dt_plan"))
     {
         EmsHeadDO.Dt_begin_ui = EmsHeadDO.Emsapobs.Dt_plan;//同步开始时间
     }
 }
コード例 #23
0
ファイル: CDCTest.cs プロジェクト: pets87/cdcsqlmonitor
 private void Monitor_OnRecordChnaged(object sender, DataChangedEventArgs e)
 {
     foreach (var item in e.ChangedEntities)
     {
         Debug.WriteLine("Operation: " + item.ChangeType.ToString() + "  Table: " + item.TableName + "\n");
         foreach (var col in item.Columns)
         {
             Debug.WriteLine("Column: " + col.Name + "  Value: " + col.Value + (col.OldValue != null ? " OldValue: " + col.OldValue :"") + "\n");
         }
         Debug.WriteLine("\n");
     }
 }
コード例 #24
0
ファイル: OrderAplabView.cs プロジェクト: fhis/order.client
 void xapFormControl1_DataChanged(object sender, DataChangedEventArgs e)
 {
     if (!string.IsNullOrEmpty(e.PropName))
     {
         switch (e.PropName)
         {
         case "Dt_plan":
             EmsHeadDO.Dt_begin_ui = EmsHeadDO.Emsaplab.Dt_plan;    //同步开始时间
             break;
         }
     }
 }
コード例 #25
0
        public override void DataChanged(DataChangedEventArgs e)
        {
            base.DataChanged(e);
            string key = e.Field.Key.ToString();

            switch (key)
            {
            case "FIsSelfGet":
                Act_DB_NotSelf();
                break;
            }
        }
コード例 #26
0
 /// <summary>
 /// 值更新
 /// </summary>
 /// <param name="e"></param>
 public override void DataChanged(DataChangedEventArgs e)
 {
     base.DataChanged(e);
     switch (e.Field.Key.ToString().ToUpperInvariant())
     {
     case "FAPPLYID":
     case "FAPPLY":
     case "F_ORA_APPLICANT":
         SetApplyValueUpdate();
         break;
     }
 }
コード例 #27
0
        /// <summary>
        /// 汇率变动 DataChanged- FRATE
        /// </summary>
        /// <param name="e"></param>
        private void Act_DC_FRate(DataChangedEventArgs e)
        {
            double _FRate = Double.Parse(this.CZ_GetValue_DF("FRate", "0"));

            //表头
            double _FGpAmt   = Double.Parse(this.CZ_GetValue_DF("FGpAmt", "0"));
            double _FGpAmtLc = _FGpAmt * _FRate;

            this.View.Model.SetValue("FGpAmtLc", _FGpAmtLc.ToString());

            //明细信息
        }
コード例 #28
0
        public override void DataChanged(DataChangedEventArgs e)
        {
            base.DataChanged(e);
            string key = e.Field.Key.ToString();

            switch (key)
            {
            case "FContractParty":
                GetContractPartyInfo(e);
                break;
            }
        }
コード例 #29
0
ファイル: MapControl.cs プロジェクト: sschuhpse/Mapsui
 public void MapDataChanged(object sender, DataChangedEventArgs e)
 {
     if (e.Cancelled || e.Error != null)
     {
         //todo test code below:
         //((Activity)Context).RunOnUiThread(new Runnable(Toast.MakeText(Context, GetErrorMessage(e), ToastLength.Short).Show));
     }
     else // no problems
     {
         ((Activity)Context).RunOnUiThread(new Runnable(RefreshGraphics));
     }
 }
コード例 #30
0
        /*
         *  触发时机:
         *  字段值更新之后触发
         *
         *  应用场景:
         *  字段值更新之后可能需要级联触发修改其他字段,针对字段值改变做一些附加处理。
         *
         *  案例演示:弹出消息框显示文本框变更前后的值
         *  特别注意:文本框字段应勾选即时触发值更新事件
         */
        public override void DataChanged(DataChangedEventArgs e)
        {
            base.DataChanged(e);
            var ctrlKey = "F_PAEZ_Text";

            if (e.Field.Key == ctrlKey)
            {
                var msg = string.Format("{0}的值被改变了\r\n原值:{1}\r\n新值:{2}"
                                        , ctrlKey, e.OldValue, e.NewValue);
                this.View.ShowMessage(msg);
            }
        }
コード例 #31
0
        public override void DataChanged(DataChangedEventArgs e)
        {
            base.DataChanged(e);
            string key = e.Field.Key.ToString();

            switch (key)
            {
            case "FSalesManID":
                SetSm();
                break;
            }
        }
コード例 #32
0
        private void Handler(object sender, DataChangedEventArgs args)
        {
            Dispatcher.Invoke(() =>
            {
                lock (_displayLock)
                {
                    TextStreamingResults.Text += Environment.NewLine;
                    TextStreamingResults.Text += string.Format("{0} {1}: {2}", args.Event, args.Path,
                        args.Data ?? "<null>");

                }
            });
        }
コード例 #33
0
ファイル: MapControl.cs プロジェクト: galchen/brutile
 async void FetcherDataChanged(object sender, DataChangedEventArgs<Image> e)
 {
     if (!Dispatcher.HasThreadAccess)
         Dispatcher.RunAsync(
            Windows.UI.Core.CoreDispatcherPriority.High,
            () => FetcherDataChanged(sender, e));
     else
     {
         if (e.Error == null && e.Tile != null)
         {
             e.Tile.Image = await CreateImage(e.Tile.Data);
             _tileCache.Add(e.Tile.Info.Index, e.Tile);
             InvalidateArrange();
         }
     }
 }
コード例 #34
0
ファイル: TableViewTest.cs プロジェクト: Nexus87/PokeClone
        public void DrawCalledTwice_ModelDataChangedRaised_RenderedComponentHasNewData()
        {
            var modelStub = new Mock<ITableModel<Object>>();
            var tableRendererMock = new TableRendererMock<Object>();
            SetDimension(modelStub, 10, 20);
            var table = CreateTable(modelStub, tableRendererMock, new Mock<ITableSelectionModel>());
            var newData = new Object();
            int row = 4;
            int column = 5;
            var eventArgs = new DataChangedEventArgs<Object>(row, column, newData);

            table.Setup();
            table.Draw();

            modelStub.Setup(o => o.DataAt(row, column)).Returns(newData);
            modelStub.Raise(o => o.DataChanged += null, modelStub.Object, eventArgs);
            table.Draw();

            var changedComponent = tableRendererMock.components[row, column];
            Assert.AreEqual(newData, changedComponent.Data);
        }
コード例 #35
0
 //用于通知数据发生改变
 protected virtual void onDataChanged()
 {
     if (dataChanged != null)
     {
         decimal sum, fav;
         if (isVipMode)
         {
             sum = 0;
             foreach (DataRow row in dt.Rows)
             {
                 sum += (decimal)(row["合计"]);
             }
             sumFinal = sum * (decimal)0.95;
             fav = sum - sumFinal;
         }
         else
         {
             fav = 0;
             sum = 0;
             foreach(DataRow row in dt.Rows)
             {
                 sum += (decimal)(row["合计"]);
             }
             sumFinal = sum - fav;
         }
         DataChangedEventArgs e = new DataChangedEventArgs(sum.ToString(), fav.ToString(), sumFinal.ToString(),count.ToString());
         dataChanged(this, e);
     }
 }
コード例 #36
0
 private void rootLayer_DataChanged(object sender, DataChangedEventArgs e)
 {
     if (!this.Dispatcher.CheckAccess())
     {
         this.Dispatcher.BeginInvoke(new DataChangedEventHandler(rootLayer_DataChanged), new object[] { sender, e });
     }
     else
     {
         if (e.Error == null && e.Cancelled == false)
         {
             this.Refresh();
         }
         else if (e.Cancelled == true)
         {
             this.errorMessage = "Cancelled";
             this.OnErrorMessageChanged(EventArgs.Empty);
         }
         /*
         else if (e.Error is System.Net.WebException)
         {
             this.errorMessage = "WebException: " + e.Error.Message;
             this.OnErrorMessageChanged(EventArgs.Empty);
         }*/
         else
         {
             this.errorMessage = e.Error.GetType().ToString() + ": " + e.Error.Message;
             this.OnErrorMessageChanged(EventArgs.Empty);
         }
     }
 }
コード例 #37
0
ファイル: MapControl.cs プロジェクト: galchen/brutile
 private void FetcherOnDataChanged(object sender, DataChangedEventArgs<Image> e)
 {
     if (!Dispatcher.CheckAccess())
         Dispatcher.Invoke(new Action(() => FetcherOnDataChanged(sender, e)));
     else
     {
         if (e.Error == null && e.Tile != null)
         {
             e.Tile.Image = TileToImage(e.Tile.Data);
             _tileCache.Add(e.Tile.Info.Index, e.Tile);
             _invalid = true;
         }
     }
 }