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


C# DataLayer.Sync方法代码示例

本文整理汇总了C#中DataLayer.Sync方法的典型用法代码示例。如果您正苦于以下问题:C# DataLayer.Sync方法的具体用法?C# DataLayer.Sync怎么用?C# DataLayer.Sync使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataLayer的用法示例。


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

示例1: ViewDidLoad

        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            string imgurl = "http://41.185.30.19/Indemnities/" + MarriedRelationshipID.ToString () + ".jpg";
            //if(RemoteFileExists(imgurl) == false) {
                // Put alternative content/message here
                btnSaveIndemnity.SetTitle ("Snap Indemnity", UIControlState.Normal);
                btnSaveIndemnity.SetTitleColor (UIColor.Red, UIControlState.Normal);
            //}
            //else
            //{
            //	// Put Internet Required Code here
            //	btnSaveIndemnity.SetTitle ("View Indemnity", UIControlState.Normal);
            //	btnSaveIndemnity.SetTitleColor (UIColor.Green, UIControlState.Normal);
            //}

            if (MarriedRelationshipID == 0) {
                DataLayer dl = new DataLayer ();
                dl.Sync ();
                MarriedRelationshipID = dl.createMarriedRelationship (0, 0);
            }

            btnSpouse1Detail.TouchUpInside += (object sender, EventArgs e) => {
                UINavigationController parent = this.NavigationController;
                PersonViewController pdvc = parent.Storyboard.InstantiateViewController("PersonViewController") as PersonViewController;
                pdvc.PersonID = Spouse1ID;
                parent.PushViewController(pdvc,true);
            };

            btnSpouse2Detail.TouchUpInside += (object sender, EventArgs e) => {
                UINavigationController parent = this.NavigationController;
                PersonViewController pdvc = parent.Storyboard.InstantiateViewController("PersonViewController") as PersonViewController;
                pdvc.PersonID = Spouse2ID;
                parent.PushViewController(pdvc,true);
            };

            btnChild1Detail.TouchUpInside += (object sender, EventArgs e) => {
                UINavigationController parent = this.NavigationController;
                ChildViewController pdvc = parent.Storyboard.InstantiateViewController("ChildViewController") as ChildViewController;
                pdvc.PersonID = Child1ID;
                parent.PushViewController(pdvc,true);
            };

            btnChild2Detail.TouchUpInside += (object sender, EventArgs e) => {
                UINavigationController parent = this.NavigationController;
                ChildViewController pdvc = parent.Storyboard.InstantiateViewController("ChildViewController") as ChildViewController;
                pdvc.PersonID = Child2ID;
                parent.PushViewController(pdvc,true);
            };

            btnChild3Detail.TouchUpInside += (object sender, EventArgs e) => {
                UINavigationController parent = this.NavigationController;
                ChildViewController pdvc = parent.Storyboard.InstantiateViewController("ChildViewController") as ChildViewController;
                pdvc.PersonID = Child3ID;
                parent.PushViewController(pdvc,true);
            };

            btnChild4Detail.TouchUpInside += (object sender, EventArgs e) => {
                UINavigationController parent = this.NavigationController;
                ChildViewController pdvc = parent.Storyboard.InstantiateViewController("ChildViewController") as ChildViewController;
                pdvc.PersonID = Child4ID;
                parent.PushViewController(pdvc,true);
            };

            btnChild5Detail.TouchUpInside += (object sender, EventArgs e) => {
                UINavigationController parent = this.NavigationController;
                ChildViewController pdvc = parent.Storyboard.InstantiateViewController("ChildViewController") as ChildViewController;
                pdvc.PersonID = Child5ID;
                parent.PushViewController(pdvc,true);
            };

            btnSpouse1.TouchUpInside += (object sender, EventArgs e) => {
                if (Spouse1ID == 0)
                {
                    UINavigationController parent = this.NavigationController;
                    PersonViewController pdvc = parent.Storyboard.InstantiateViewController("PersonViewController") as PersonViewController;
                    pdvc.PersonID = 0;
                    pdvc.MarriedRelionshipID = MarriedRelationshipID;
                    pdvc.Relationship = 1;
                    parent.PushViewController(pdvc,true);
                }
                else
                {
                    if (Spouse2ID == 0)
                    {
                        DataLayer db = new DataLayer();
                        db.deleteSpouse1(MarriedRelationshipID);
                        this.Title = "Add Household";
                        loadHousehold();
                    }
                    else
                    {
                        UIAlertView alert = new UIAlertView("Can't delete","Delete the second spouse before deleting the first",null,"OK",null);
                        alert.Show();
                    }

                }
            };

//.........这里部分代码省略.........
开发者ID:Wazzo79,项目名称:Illumin8---Kids-Checkin-App,代码行数:101,代码来源:HouseholdDetailViewController.cs

示例2: loadHouseholds

        void loadHouseholds()
        {
            Database db = new Database ();
            DataLayer dl = new DataLayer ();
            LoadingOverlay loadingOverlay = new LoadingOverlay (View.Bounds);
            db.Initialize ();
            dl.Sync ();
            int campusID = db.getCampusID ();
            households = dl.getHouseholds(campusID);

            searchBar.Text = "";
            tblHouseholds.Source = new HouseholdTableSource(households,"", this);
            tblHouseholds.ReloadData();
        }
开发者ID:Wazzo79,项目名称:Illumin8---Kids-Checkin-App,代码行数:14,代码来源:HouseholdsViewController.cs


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