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


C# DataManager类代码示例

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


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

示例1: Test_TwoWayReference_RemoveOnDelete

        // TODO: Remove or reimplement
        //[Test]
        public void Test_TwoWayReference_RemoveOnDelete()
        {
            Console.WriteLine ("");
            Console.WriteLine ("Preparing test...");
            Console.WriteLine ("");

            var data = new DataManager();
            data.Settings.IsVerbose = true;

            data.WriteSummary ();

            var invoiceItem = new ExampleInvoiceItem ();
            var invoice = new ExampleInvoice (invoiceItem);

            data.Save(invoice, true);

            data.WriteSummary ();

            Console.WriteLine ("");
            Console.WriteLine ("Executing test code...");
            Console.WriteLine ("");

            data.Delete(invoice);

            data.WriteSummary ();

            var newInvoice = data.Get<ExampleInvoice> (invoice.Id);

            Assert.AreEqual(0, newInvoice.Items.Length, "Linker failed to remove the link.");
        }
开发者ID:CompulsiveCoder,项目名称:datamanager,代码行数:32,代码来源:DataLinkerIntegrationTestFixture.cs

示例2: ExpeditePage

 public ExpeditePage()
 {
     this.InitializeComponent();
     DataManager thisDataManager = new DataManager();
     int x;
     x = 0;
 }
开发者ID:albatross666,项目名称:xaml-beginner,代码行数:7,代码来源:ExpeditePage.xaml.cs

示例3: GetUser

 public User GetUser(int id)
 {
     using (var manager = new DataManager())
     {
         return manager.Context.Users.SingleOrDefault(u => u.UserId == id);
     }
 }
开发者ID:RashitL,项目名称:TeamStudio,代码行数:7,代码来源:UsersService.cs

示例4: Start

    public void Start()
    {
        dataManager = DataManager.instance;
        infiniteObjectManager = InfiniteObjectManager.instance;
        infiniteObjectManager.init();
        infiniteObjectHistory = InfiniteObjectHistory.instance;
        infiniteObjectHistory.init(infiniteObjectManager.getTotalObjectCount());
        sectionSelection = SectionSelection.instance;
        chaseController = ChaseController.instance;

        moveDirection = Vector3.forward;
        spawnDirection = Vector3.forward;
        turnPlatform = new PlatformObject[(int)ObjectLocation.Last];

        infiniteObjectManager.getObjectSizes(out platformSizes, out sceneSizes, out largestSceneLength);
        infiniteObjectManager.getObjectStartPositions(out platformStartPosition, out sceneStartPosition);

        stopObjectSpawns = false;
        spawnData = new ObjectSpawnData();
        spawnData.largestScene = largestSceneLength;
        spawnData.useWidthBuffer = true;
        spawnData.section = 0;
        spawnData.sectionTransition = false;

        noCollidableProbability.init();

        showStartupObjects(GameManager.instance.showTutorial);

        spawnObjectRun(true);
    }
开发者ID:Blavtes,项目名称:RunInto,代码行数:30,代码来源:InfiniteObjectGenerator.cs

示例5: GetVersion

 public InoSoft.TeamStudio.Core.Entities.Version GetVersion(string VersionNum)
 {
     using (var Manager = new DataManager())
     {
         return Manager.Context.Versions.SingleOrDefault(v => v.VersionNum == VersionNum);
     }
 }
开发者ID:RashitL,项目名称:TeamStudio,代码行数:7,代码来源:VersionService.cs

示例6: GetAllUsers

 public List<User> GetAllUsers()
 {
     using (var manager = new DataManager())
     {
         return manager.Context.Users.ToList();
     }
 }
开发者ID:RashitL,项目名称:TeamStudio,代码行数:7,代码来源:UsersService.cs

示例7: DoSave

 // public DsMaster.STOREMASTRow StoremastRow;
 public string DoSave()
 {
     string retval="0";
     SqlTransaction tran = null;
     var isnew = false;
     try
     {
         var cn = new SqlConnection {ConnectionString = _constr};
         cn.Open();
         tran = cn.BeginTransaction(IsolationLevel.ReadUncommitted);
         var dt = new DsMaster().STOREMAST;
         var ta = new DsMasterTableAdapters.STOREMASTTableAdapter();
         ta.Connection.ConnectionString = _constr;
         ta.Fill(dt);
         ta.AssignConnection(cn, tran);
         var dr = dt.FindBySTORECODE(storecode);
         if (dr != null)
         {
             dr.BeginEdit();
             dr.EditedBy = Utils.Userid;
         }
         else
         {
             dr = (DsMaster.STOREMASTRow) dt.NewRow();
             isnew = true;
             var autoid = new DataManager().GetAutoId(9);
             autoid++;
             storecode = String.Format("{0,-2:D2}", autoid);
             dr.CREATEDBY = Utils.Userid;
             dr.CREATEDATE = System.DateTime.Now.Date;
         }
         dr.STORECODE = storecode;
         dr.STORETYPE = storetype;
         dr.STORENAME = storename;
         dr.ADDRESSS = address;
         dr.PHONENO = phono;
         dr.FAXNO = fax;
         dr.COMM = communicationtype;
         dr.COMPANY = COMPANY;
         if (isnew)
         {
             dt.Rows.Add(dr);
             ta.Update(dt);
         }
         else
         {
             dr.EndEdit();
             ta.Update(dt);
         }
         new DataManager().UpdateAutoNum(9);
         tran.Commit();
         retval = "1";
     }
     catch (Exception ex)
     {
         retval = ex.ToString();
         if (tran != null) tran.Rollback();
     }
     return retval;
 }
开发者ID:rehman922,项目名称:VIRETAIL,代码行数:61,代码来源:Masters.cs

示例8: SetUp

        public void SetUp()
        {
            this.dataManager = new DataManager(null, null, 0, 0, 10);
            this.dataManager.CompactionConfiguration = this.defaultCompactionConfig;

            foreach (var d in AnyKeys.Dimensions) AnyDimensions[d.Name] = AnyDimValue;
        }
开发者ID:darting,项目名称:MetricSystem,代码行数:7,代码来源:DataManagerTests.cs

示例9: GetTasksAboutUser

 public List<Task> GetTasksAboutUser(int UserID)
 {
     using (var Manager = new DataManager())
     {
         return Manager.Context.Tasks.Where(u => u.AssigneeId == UserID).ToList();
     }
 }
开发者ID:RashitL,项目名称:TeamStudio,代码行数:7,代码来源:TasksService.cs

示例10: GetTasksAboutProject

 public List<Task> GetTasksAboutProject(int ProjectId, int UserId)
 {
     using (var Manager = new DataManager())
     {
         return Manager.Context.Tasks.Where(u => u.ProjectId == ProjectId && u.AssigneeId == UserId).ToList();
     }
 }
开发者ID:RashitL,项目名称:TeamStudio,代码行数:7,代码来源:TasksService.cs

示例11: GetTask

 public Task GetTask(int TaskId)
 {
     using (var Manager = new DataManager())
     {
         return Manager.Context.Tasks.SingleOrDefault(u => u.TaskId == TaskId);
     }
 }
开发者ID:RashitL,项目名称:TeamStudio,代码行数:7,代码来源:TasksService.cs

示例12: GetAllChildrenTasks

 public List<Task> GetAllChildrenTasks(int TaskId)
 {
     using (var Manager = new DataManager())
     {
         return Manager.Context.Tasks.Where(u => u.ParentTaskId == TaskId).ToList();
     }
 }
开发者ID:RashitL,项目名称:TeamStudio,代码行数:7,代码来源:TasksService.cs

示例13: Start

    private void Start()
    {
        if(!Startup.dataInitialized)
        {
            directorData = Resources.Load ("DirectorData") as DirectorData;
            dataManager = new DataManager();

            SetDirectorDataForThisScene();
            directorData.totalSceneTime = 0f;
            directorData.totalDuration = (float)dataManager.script.totalSpan.TotalSeconds;
            Startup.dataInitialized = true;
        }

        directorData.elapsedSceneTime = 0f;
        directorData.nextSceneMomentID = GetNextSceneMomentID();
        directorData.totalSceneTime = (float)currentScene.startTime.TotalSeconds;
        selectedMomentButtonID = directorData.currentMomentID;

        LoadButtons();

        timeSlider.minValue = 0;
        timeSlider.maxValue = directorData.totalDuration;

        primaryInfoText.text = "";
        secondaryInfoText.text = "";
        timeTextB.text = dataManager.script.totalSpan.ToString ();

        SetMomentButtons(directorData.currentAct, directorData.currentScene);
        SetDirectorMode (DirectorMode.MOMENT);
    }
开发者ID:JeffreyMJohnson,项目名称:ProjectKansas,代码行数:30,代码来源:Director.cs

示例14: OrderPage

        public OrderPage()
        {
            this.InitializeComponent();
            var dM = new DataManager();

            LV.ItemsSource = dM.OrderItems;
        }
开发者ID:mknight9090,项目名称:xaml-beginner,代码行数:7,代码来源:OrderPage.xaml.cs

示例15: GetAllVersion

 public List<InoSoft.TeamStudio.Core.Entities.Version> GetAllVersion()
 {
     using (var manager = new DataManager())
     {
         return manager.Context.Versions.ToList();
     }
 }
开发者ID:RashitL,项目名称:TeamStudio,代码行数:7,代码来源:VersionService.cs


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