当前位置: 首页>>代码示例>>C#>>正文


C# LoadOperation类代码示例

本文整理汇总了C#中LoadOperation的典型用法代码示例。如果您正苦于以下问题:C# LoadOperation类的具体用法?C# LoadOperation怎么用?C# LoadOperation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LoadOperation类属于命名空间,在下文中一共展示了LoadOperation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SaveData

        private void SaveData(LoadOperation<ma_diaban> lo)
        {

            if (lo.Entities.Count() > 0)
            {
                MessageBox.Show("Mã tuyến " + this.txtmanv.Text.Trim().ToUpper() + " đã tồn tại");
            }
            else
            {

                if (txtmanv.Text.Trim() != "" || txtten.Text.Trim() != "")
                {
                    ma_diaban ap = new ma_diaban
                    {
                       ma_tuyen = txtmanv.Text.Trim().ToUpper(),
                       ten_tuyen = this.txtten.Text.Trim(),
                       ma_huyen=App.ma_huyen,
                       kt=checkEdit1.IsChecked                       
                    };
                    dstb.ma_diabans.Add(ap);
                    dstb.SubmitChanges(OnSubmitCompleted, true);
                }
                else
                    MessageBox.Show("Nhập chưa đủ thông tin hoặc sai qui cách nhập mã tuyến !");
            }
        }
开发者ID:phanvanthanh,项目名称:QLThueBao,代码行数:26,代码来源:frmnhapdiaban.xaml.cs

示例2: LoadOpTT_Complete

        void LoadOpTT_Complete(LoadOperation<nv_thuethu> lo)
        {
            if (lo.Entities.Count() > 0)
            {
                this.cmbtuyen.ItemsSource = lo.Entities;
                this.cmbtuyen.DisplayMember = ("ten").Trim();
                this.cmbtuyen.ValueMember = "ten";
                this.cmbtuyen1.ItemsSource = lo.Entities;
                this.cmbtuyen1.DisplayMember = ("ten").Trim();
                this.cmbtuyen1.ValueMember = "ten";
                if (m_tuyen != "")
                {
                     for (int i = 0; i < LoadOptuyen.Entities.Count(); i++)
                    {
                        if (cmbtuyen.GetKeyValue(i).ToString().Trim() == m_tuyen)
                        {
                            cmbtuyen.SelectedIndex = i;
                        }
                    }
                }
                else                
                    this.cmbtuyen.SelectedIndex = 0;
                dien_dl(cmbtuyen.Text.Trim());

            }
        }
开发者ID:phanvanthanh,项目名称:QLThueBao,代码行数:26,代码来源:frmtuyenthu.xaml.cs

示例3: SaveData

        private void SaveData(LoadOperation<nv_thuethu> lo)
        {

            if (lo.Entities.Count() > 0)
            {
                MessageBox.Show("Tuyến thu " + this.txttuyen.Text.Trim().ToUpper() + " đã tồn tại");
            }
            else
            {               

                if (txttuyen.Text.Trim() != "" || txtten.Text.Trim() != "")
                {
                    nv_thuethu nv = new nv_thuethu
                    {
                        ten = txttuyen.Text.Trim().ToUpper(),
                        ten_nv = txtten.Text.Trim(),
                        ghi_chu=txtghichu.Text.Trim(),
                        ma_huyen=App.ma_huyen
                    };
                    dstb.nv_thuethus.Add(nv);
                    dstb.SubmitChanges(OnSubmitCompleted, true);                             
                }
                else
                    MessageBox.Show("Nhập chưa đủ thông tin");
            }
        }
开发者ID:phanvanthanh,项目名称:QLThueBao,代码行数:26,代码来源:frmnhapnv.xaml.cs

示例4: OnOrdersLoaded

        private void OnOrdersLoaded( LoadOperation<Order> operation )
        {
            // When the data is loaded, raise the property changed event for the Orders property.
            if ( !operation.HasError ) NotifyPropertyChanged( "Orders" );

            // TODO: Check for and handle any load errors...
        }
开发者ID:CarlosVV,项目名称:mediavf,代码行数:7,代码来源:OrderListViewModel.cs

示例5: LoadOp_Complete

 void LoadOp_Complete(LoadOperation<rp_tklydocat> lo)
 {            
     gridControl1.ItemsSource = lo.Entities;
     gridControl1.GroupBy("ten_dv");
     gridControl1.ExpandAllGroups();
     gridControl1.ShowLoadingPanel = false;
 }
开发者ID:phanvanthanh,项目名称:QLThueBao,代码行数:7,代码来源:frmtklydocat.xaml.cs

示例6: LoadSysSetCompleted

        private void LoadSysSetCompleted(LoadOperation<t_Sys_MainRealTimeSet> result)
        {
            if (result.HasError)
            {
                MessageBox.Show("加截设置参数出错!", "出错啦!", MessageBoxButton.OK);
                return;
            }
            if (result.Entities.Count() == 0)
            {
                MessageBox.Show("还未设置参数!", "出错啦!", MessageBoxButton.OK);
                return;
            }

            SysSetReal = result.Entities.First();
            realTime.Ylower = SysSetReal.Ylower;
            realTime.Yupper = SysSetReal.Yupper;
            realTime.YmaxValue = SysSetReal.YmaxValue;
            realTime.YminValue = SysSetReal.YminValue;
            realTime.GridHeight = SysSetReal.GridHeight;
            realTime.BackColor = Colors.Black;
            realTime.ForeColor = Colors.Red;
            //先加载一个值
            timer_Tick(null,null);
            timer.Start();
        }
开发者ID:Jitlee,项目名称:MonitorProject,代码行数:25,代码来源:MainRealtimeCurve.xaml.cs

示例7: LoadOpCompleteExits

 void LoadOpCompleteExits(LoadOperation<BSCT> lo)
 {
     if (lo.Entities.Count() > 0)
     {
         for (int i = 0; i < lo.Entities.Count(); i++)
         {
             (this.gridControl2.ItemsSource as BSC_tinh_temp).Add(new BSCT
             {
                 ma_kpi = lo.Entities.ElementAt(i).ma_kpi.ToString().Trim(),
                 ten_kpi = lo.Entities.ElementAt(i).ten_kpi.ToString().Trim(),
                 ten_kpo = lo.Entities.ElementAt(i).ten_kpo.ToString().Trim(),
                 dvt = lo.Entities.ElementAt(i).dvt.ToString().Trim(),
                 //check = lo.Entities.ElementAt(i).check==null? false: lo.Entities.ElementAt(i).check,
                 chitieugiao = lo.Entities.ElementAt(i).chitieugiao == null ? 0 : (double)lo.Entities.ElementAt(i).chitieugiao,
                 chitieuth = lo.Entities.ElementAt(i).chitieuth == null ? 0 : (double)lo.Entities.ElementAt(i).chitieuth,
                 trongso = lo.Entities.ElementAt(i).trongso == null ? 0 : (double)lo.Entities.ElementAt(i).trongso,
                 ty_trong_thuc_hien = lo.Entities.ElementAt(i).ty_trong_thuc_hien == null ? 0 : (double)lo.Entities.ElementAt(i).ty_trong_thuc_hien
             });
         }
         gridControl2.GroupBy("ten_kpo");
         gridControl2.ExpandAllGroups();
     }
     get_data();
     gridControl2.ShowLoadingPanel = false;
 }
开发者ID:phanvanthanh,项目名称:QLThueBao,代码行数:25,代码来源:frmbscnld.xaml.cs

示例8: SaveData

        private void SaveData(LoadOperation<kh_mai> lo)
        {

            if (lo.Entities.Count() > 0)
            {
                MessageBox.Show("Mã chương trình " + this.txtmakm.Text.Trim().ToUpper() + " đã tồn tại");
            }
            else
            {

                if (txtmakm.Text.Trim() != "" || txtten.Text.Trim() != "")
                {
                    kh_mai km = new kh_mai
                    {
                        ma_km = txtmakm.Text.Trim().ToUpper(),
                        ten_ct = txtten.Text.Trim(),
                        ngay_bd = dbatdau.DateTime,
                        ngay_kt=dketthuc.DateTime,
                        hieu_luc= chkhieuluc.IsChecked == true ? true : false
                    };
                    dstb.kh_mais.Add(km);
                    dstb.SubmitChanges(OnSubmitCompleted, true);
                }
                else
                    MessageBox.Show("Nhập chưa đủ thông tin");
            }
        }
开发者ID:phanvanthanh,项目名称:QLThueBao,代码行数:27,代码来源:frmnhapkm.xaml.cs

示例9: Operation_MarkAsHandled

        public void Operation_MarkAsHandled()
        {
            TestDataContext ctxt = new TestDataContext(new Uri(TestURIs.RootURI, "TestDomainServices-TestCatalog1.svc"));

            var query = ctxt.CreateQuery<Product>("ThrowGeneralException", null, false, true);
            LoadOperation lo = new LoadOperation<Product>(query, LoadBehavior.KeepCurrent, null, null, null);

            EventHandler action = (o, e) =>
            {
                LoadOperation loadOperation = (LoadOperation)o;
                if (loadOperation.HasError)
                {
                    loadOperation.MarkErrorAsHandled();
                }
            };
            lo.Completed += action;

            DomainOperationException ex = new DomainOperationException("Operation Failed!", OperationErrorStatus.ServerError, 42, "StackTrace");
            lo.Complete(ex);

            // verify that calling MarkAsHandled again is a noop
            lo.MarkErrorAsHandled();
            lo.MarkErrorAsHandled();

            // verify that calling MarkAsHandled on an operation not in error
            // results in an exception
            lo = new LoadOperation<Product>(query, LoadBehavior.KeepCurrent, null, null, null);
            Assert.IsFalse(lo.HasError);
            Assert.IsTrue(lo.IsErrorHandled);
            ExceptionHelper.ExpectInvalidOperationException(delegate
            {
                lo.MarkErrorAsHandled();
            }, Resource.Operation_HasErrorMustBeTrue);
        }
开发者ID:OpenRIAServices,项目名称:OpenRiaServices,代码行数:34,代码来源:OperationTests.cs

示例10: GetCategories

 public void GetCategories(Action<ObservableCollection<Category>> getCategoriesCallback)
 {
     _getCategoriesCallback = getCategoriesCallback;
     Context.Categories.Clear();
     _categoriesLoadOperation = Context.Load<Category>(Context.GetCategoriesQuery());
     _categoriesLoadOperation.Completed += OnLoadCategoriesCompleted;
 }
开发者ID:luiseduardohdbackup,项目名称:dotnet-1,代码行数:7,代码来源:BookDataService.old.cs

示例11: SaveData

        private void SaveData(LoadOperation<ma_ap> lo)
        {

            if (lo.Entities.Count() > 0)
            {
                MessageBox.Show("Mã xã phường " + this.txtmaap.Text.Trim().ToUpper() + " đã tồn tại");
            }
            else
            {

                if (txtmaap.Text.Trim() != "" || txtten.Text.Trim() != "")
                {
                    ma_ap ap = new ma_ap
                    {
                       maxa = m_maxa,
                       maap = this.txtmaap.Text.Trim().ToUpper(),
                       ten_ap = txtten.Text.Trim()            
                    };
                    dstb.ma_aps.Add(ap);
                    dstb.SubmitChanges(OnSubmitCompleted, true);
                }
                else
                    MessageBox.Show("Nhập chưa đủ thông tin");
            }
        }
开发者ID:phanvanthanh,项目名称:QLThueBao,代码行数:25,代码来源:frmnhapap.xaml.cs

示例12: SaveData

        private void SaveData(LoadOperation<tram_vt> lo)
        {

            if (lo.Entities.Count() > 0)
            {
                MessageBox.Show("Mã trạm viễn thông " + this.txtmaxa.Text.Trim().ToUpper() + " đã tồn tại");
            }
            else
            {

                if (txtmaxa.Text.Trim() != "" || txtten.Text.Trim() != "")
                {
                    tram_vt tram = new tram_vt
                    {
                        ma_tram = txtmaxa.Text.Trim().ToUpper(),
                        ten_tram = txtten.Text.Trim(),                        
                        ma_huyen = App.ma_huyen
                    };
                    dstb.tram_vts.Add(tram);
                    dstb.SubmitChanges(OnSubmitCompleted, true);
                }
                else
                    MessageBox.Show("Nhập chưa đủ thông tin");
            }
        }
开发者ID:phanvanthanh,项目名称:QLThueBao,代码行数:25,代码来源:frmnhaptram.xaml.cs

示例13: frmcatint

 public frmcatint(string usr)
 {
     InitializeComponent();
     EntityQuery<tram_vt> Query = dstb.GetTram_vtQuery();
     LoadOp = dstb.Load(Query.Where(t => App.ma_huyen.Contains(t.ma_huyen)).OrderBy(p => p.ten_tram), LoadOpT_Complete, null);
     //QLThuebaoDomainContext tramvt = new QLThuebaoDomainContext();
     EntityQuery<khmai> Querykm = dstb.GetKhmaiQuery();
     LoadOpkm = dstb.Load(Querykm.OrderByDescending(t => t.ngay_bd), LoadOpTK_Complete, null);
     EntityQuery<mlydocat> Querycat = dstb.GetLyDoCatTrimQuery();
     LoadOpcat = dstb.Load(Querycat.OrderBy(p => p.m_order), LoadOpCT_Complete, null);
     EntityQuery<loaikh> Queryloai = dstb.GetLoaikhQuery();
     LoadOpkh = dstb.Load(Queryloai, LoadOpKH_Complete, null);
     EntityQuery<nganh_nghe> QueryN = dstb.GetNganh_ngheQuery();
     LoadOpN = dstb.Load(QueryN, LoadOpN_Complete, null);
     EntityQuery<loai_dv> Queryloaidv = dstb.GetLoai_dvQuery();
     LoadOpdv = dstb.Load(Queryloaidv, LoadOpDV_Complete, null);            
     EntityQuery<KhachHangUuTien> Queryut = dstb.GetKhachHangUuTienTrimQuery();
     LoadOput = dstb.Load(Queryut.OrderBy(p => p.kh_uutien1), LoadOpUT_Complete, null);
     EntityQuery<nv_thuethu> Queryt = dstb.GetNv_thuethuQuery();
     LoadOptuyen = dstb.Load(Queryt.Where(p => p.ma_huyen == App.ma_huyen).OrderBy(p => p.ten), LoadOpTT_Complete, null);
     //this.txtsdt.MaxLength = App.len_sdt;
     m_usr = usr;
     dngaycat.EditValue = App.Current_d;           
     mlydo.IsEnabled = false;
     Loaded += new RoutedEventHandler(frmeditmy_Loaded);  
     //frmdc = new frmdiachi();
     //frmdc.Closed += new EventHandler(frmdiachi_Closed); 
    
 }
开发者ID:phanvanthanh,项目名称:QLThueBao,代码行数:29,代码来源:frmcatint.xaml.cs

示例14: frmdoiaccountmytv

 public frmdoiaccountmytv()
 {
     InitializeComponent();
     OKButton.IsEnabled = false;
     EntityQuery<gc_mytv> Querygc = dstb.GetGc_mytvQuery();
     LoadOpgc = dstb.Load(Querygc.OrderBy(p => p.ma_goi), LoadOpGC_Complete, null);                       
 }
开发者ID:phanvanthanh,项目名称:QLThueBao,代码行数:7,代码来源:frmdoiaccountmytv.xaml.cs

示例15: LoadData

 public void LoadData()
 {
     //todo:Login için Menüleri göster,gösterme olayı yapmaya başladım.
     //DLoginLoadOp = ds.Load(ds.GetLoginQuery(txtUserName.Text, txtPassword.Password), false);
     DLoginLoadOp = context.Load(context.LoginRoleQuery(txtUserName.Text, txtPassword.Password), true);
     DLoginLoadOp.Completed += DLoginLoadOp_Completed;
 }
开发者ID:serdarkaracay,项目名称:SLSpa,代码行数:7,代码来源:pageLogon.xaml.cs


注:本文中的LoadOperation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。