本文整理汇总了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.");
}
示例2: ExpeditePage
public ExpeditePage()
{
this.InitializeComponent();
DataManager thisDataManager = new DataManager();
int x;
x = 0;
}
示例3: GetUser
public User GetUser(int id)
{
using (var manager = new DataManager())
{
return manager.Context.Users.SingleOrDefault(u => u.UserId == id);
}
}
示例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);
}
示例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);
}
}
示例6: GetAllUsers
public List<User> GetAllUsers()
{
using (var manager = new DataManager())
{
return manager.Context.Users.ToList();
}
}
示例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;
}
示例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;
}
示例9: GetTasksAboutUser
public List<Task> GetTasksAboutUser(int UserID)
{
using (var Manager = new DataManager())
{
return Manager.Context.Tasks.Where(u => u.AssigneeId == UserID).ToList();
}
}
示例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();
}
}
示例11: GetTask
public Task GetTask(int TaskId)
{
using (var Manager = new DataManager())
{
return Manager.Context.Tasks.SingleOrDefault(u => u.TaskId == TaskId);
}
}
示例12: GetAllChildrenTasks
public List<Task> GetAllChildrenTasks(int TaskId)
{
using (var Manager = new DataManager())
{
return Manager.Context.Tasks.Where(u => u.ParentTaskId == TaskId).ToList();
}
}
示例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);
}
示例14: OrderPage
public OrderPage()
{
this.InitializeComponent();
var dM = new DataManager();
LV.ItemsSource = dM.OrderItems;
}
示例15: GetAllVersion
public List<InoSoft.TeamStudio.Core.Entities.Version> GetAllVersion()
{
using (var manager = new DataManager())
{
return manager.Context.Versions.ToList();
}
}