• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# LoadOperation类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



LoadOperation类属于命名空间,在下文中一共展示了LoadOperation类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: SaveData

        private void SaveData(LoadOperation<ma_xa> lo)
        {

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

                if (txtmaxa.Text.Trim() != "" || txtten.Text.Trim() != "")
                {
                    ma_xa xa = new ma_xa
                    {
                        maxa = txtmaxa.Text.Trim().ToUpper(),
                        ten = txtten.Text.Trim(),
                        tientb = 20000,
                        vtci=false,
                        ma_huyen = App.ma_huyen
                    };
                    dstb.ma_xas.Add(xa);
                    dstb.SubmitChanges(OnSubmitCompleted, true);
                }
                else
                    MessageBox.Show("Nhập chưa đủ thông tin");
            }
        }
开发者ID:phanvanthanh,项目名称:QLThueBao,代码行数:27,代码来源:frmnhapxa.xaml.cs


示例14: LoginUserLoaded

        private void LoginUserLoaded(LoadOperation<User> result)
        {
            if (result.Error == null)
            {
                Login.LoginUser = null;
                foreach (User user in result.Entities)
                    Login.LoginUser = user;

                if (Login.LoginUser != null)
                {
                    SmartMap_DomainContext context = new SmartMap_DomainContext();
                    LoadOperation loadOp = context.Load(context.GetRolePermissionsQuery(Login.LoginUser.RoleID), PermissionsLoaded, null);
                }
                else
                {
                    if (_loadingAnm != null)
                        _loadingAnm.Visibility = Visibility.Collapsed;
                    MessageBox.Show("Incorrect Username or password.");
                }
            }
            else
            {
                if (_loadingAnm != null)
                    _loadingAnm.Visibility = Visibility.Collapsed;
                string msg = result.Error.Message;
                if (result.Error.InnerException != null)
                    msg += ("Inner: \n" + result.Error.InnerException.Message);
                MessageBox.Show("Custom Error Handler:\n"+ msg);
            }
        }
开发者ID:naimheshmati,项目名称:Sanofi,代码行数:30,代码来源:Login.xaml.cs


示例15: LoadOp_Complete

        void LoadOp_Complete(LoadOperation<don_vi> lo)
        {
            if (lo.Entities.Count() > 0)
            {
                this.cmbhuyen.ItemsSource = lo.Entities;
                this.cmbhuyen.DisplayMember = ("ten_dv").Trim();
                this.cmbhuyen.ValueMember = "ma_dv";

                this.cmbhuyentd.ItemsSource = lo.Entities;
                this.cmbhuyentd.DisplayMember = ("ten_dv").Trim();
                this.cmbhuyentd.ValueMember = "ma_dv";
                if (m_update) // neu cap nhat thi xem coi user do duoc quyen su dung menu nao
                {                   
                    foreach (string s in m_huyen)
                    {
                        foreach (var p in lo.Entities)
                        {
                            if (p.ma_dv.Trim() == s)
                                this.cmbhuyentd.SelectedItems.Add(p);
                        }
                    }
                    for (int i = 0; i < lo.Entities.Count(); i++)
                    {
                        if (lo.Entities.ElementAt(i).ma_dv.Trim() == dv)
                            cmbhuyen.SelectedIndex = i;
                    }
                }
                rowHuyen = lo.Entities.Count(); // de biet duoc so dong trong combobox do items.count luon =0
            }
        }
开发者ID:phanvanthanh,项目名称:QLThueBao,代码行数:30,代码来源:frmnhapuser.xaml.cs


示例16: GetBooksOfTheDay

 public void GetBooksOfTheDay(Action<ObservableCollection<BookOfDay>> getBooksOfTheDayCallback)
 {
     _getBooksOfTheDayCallback = getBooksOfTheDayCallback;
     Context.BookOfDays.Clear();
     _booksOfTheDayLoadOperation = Context.Load<BookOfDay>(Context.GetBookOfDaysQuery());
     _booksOfTheDayLoadOperation.Completed += OnLoadBookOfTheDayCompleted;
 }
开发者ID:luiseduardohdbackup,项目名称:dotnet-1,代码行数:7,代码来源:BookDataService.old.cs


示例17: AllProductProvinceGroupings_Loaded

        private void AllProductProvinceGroupings_Loaded(LoadOperation<ProductProvinceGrouping> result)
        {
            List<int> alreadySetProducts = new List<int>();
            if (Utils.LoadOperation_Error_Handled(result.Error, "SmartMap"))
                foreach (ProductProvinceGrouping ppg in result.Entities)
                    alreadySetProducts.Add(ppg.ProductMapID);

            List<string> productNames = new List<string>();
            foreach (ProductMap pm in DBUtils.GetAllProducts())
            {
                if (productNames.Contains(pm.CD_BrandDIName) || pm.CD_BrandDIName == null || pm.CD_BrandDIName.Trim() == "")
                    continue;
                productNames.Add(pm.CD_BrandDIName);
                SolidColorBrush foreground = new SolidColorBrush(Colors.Black);
                if (alreadySetProducts.Contains(pm.ProductMapID))
                    foreground = new SolidColorBrush(Colors.Gray);
            
                
                if (_selectedProductMapIds != null && _selectedProductMapIds.Contains(pm.ProductMapID))
                    SelectedProductsList.Items.Add(new ListBoxItem() { Content = pm.CD_BrandDIName, Tag = pm.ProductMapID, Foreground = foreground });
                else
                    ProductsList.Items.Add(new ListBoxItem() { Content = pm.CD_BrandDIName, Tag = pm.ProductMapID, Foreground = foreground });
            }
            if (ProductsLoading != null)
                ProductsLoading.Visibility = System.Windows.Visibility.Collapsed;
            else
                _hideLoading = true;
        }
开发者ID:naimheshmati,项目名称:Sanofi,代码行数:28,代码来源:SelectProductWindow.xaml.cs


示例18: GetMaterialClassesCallback

        public void GetMaterialClassesCallback(LoadOperation<MaterialClass> loadOperation)
        {
            if (loadOperation.HasError)
                throw loadOperation.Error;

            //we are ready now to display the HomePage.
            ((Grid)this.RootVisual).Children.Add(new MainPage());
        }
开发者ID:mikestam,项目名称:t2t,代码行数:8,代码来源:App1.cs


示例19: LoadOpTT_Complete

 void LoadOpTT_Complete(LoadOperation<nv_thuethu> lo)
 {
     if (lo.Entities.Count() > 0)
     {
         gridControl1.ItemsSource = lo.Entities;
         gridControl1.ShowLoadingPanel = false;
     }
 }
开发者ID:phanvanthanh,项目名称:QLThueBao,代码行数:8,代码来源:frmthuethu.xaml.cs


示例20: 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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# LoadOptions类代码示例发布时间:2022-05-24
下一篇:
C# LoadMode类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap