本文整理汇总了C#中GMS.Project.DAL.ProjectDbContext.Update方法的典型用法代码示例。如果您正苦于以下问题:C# ProjectDbContext.Update方法的具体用法?C# ProjectDbContext.Update怎么用?C# ProjectDbContext.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GMS.Project.DAL.ProjectDbContext
的用法示例。
在下文中一共展示了ProjectDbContext.Update方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SaveProjectBasedata
public void SaveProjectBasedata(ProjectBasedata project)
{
using (var dbContext = new ProjectDbContext())
{
if (project.ID>0)
{
dbContext.Update<ProjectBasedata>(project);
}
else
{
dbContext.Insert<ProjectBasedata>(project);
}
}
}
示例2: SaveBudget
public void SaveBudget(BudgetInfo budget)
{
using (var dbContext = new ProjectDbContext())
{
if (budget.ID >0)
{
dbContext.Update<BudgetInfo>(budget);
}
else
{
dbContext.Insert<BudgetInfo>(budget);
}
}
}
示例3: SaveInsOverhead
public void SaveInsOverhead(InsOverhead insoverhead)
{
using (var dbContext = new ProjectDbContext())
{
//var budgets = dbContext.Budgets.ToList();
if (insoverhead.ID > 0)
{
// if (overhead.OverheadTotal > 0)
// {
// foreach (var budget in budgets)
// {
// if (budget.ProjectID == overhead.ProjectID)
// {
// budget.OverheadID = overhead.ID;
// dbContext.Update<BudgetInfo>(budget);
// }
// }
// }
dbContext.Update<InsOverhead>(insoverhead);
}
else
{
dbContext.Insert<InsOverhead>(insoverhead);
}
}
}
示例4: SaveInsMeasure
public void SaveInsMeasure(InsMeasure insmeasure)
{
using (var dbContext = new ProjectDbContext())
{
if (insmeasure.ID > 0)
{
//var budgets = dbContext.Budgets.ToList();
//if (measure.MeasureTotal > 0)
//{
// foreach (var budget in budgets)
// {
// if (budget.ProjectID == measure.ProjectID)
// {
// budget.MeasureID = measure.ID;
// dbContext.Update<BudgetInfo>(budget);
// }
// }
//}
dbContext.Update<InsMeasure>(insmeasure);
}
else
{
dbContext.Insert<InsMeasure>(insmeasure);
}
}
}
示例5: SaveInsMachineryCost
public void SaveInsMachineryCost(InsMachineryCost insmachinerycost)
{
using (var dbContext = new ProjectDbContext())
{
if (insmachinerycost.ID > 0)
{
//var budgets = dbContext.Budgets.ToList();
//if (machinerycost.MachineryTotal > 0)
//{
// foreach (var budget in budgets)
// {
// if (budget.ProjectID == machinerycost.ProjectID)
// {
// budget.MachineryCostID = machinerycost.ID;
// dbContext.Update<BudgetInfo>(budget);
// }
// }
//}
dbContext.Update<InsMachineryCost>(insmachinerycost);
}
else
{
dbContext.Insert<InsMachineryCost>(insmachinerycost);
}
}
}
示例6: SaveInsBudget
public void SaveInsBudget(InsBudgetInfo insbudget)
{
using (var dbContext = new ProjectDbContext())
{
if (insbudget.ID > 0)
{
dbContext.Update<InsBudgetInfo>(insbudget);
}
else
{
dbContext.Insert<InsBudgetInfo>(insbudget);
}
}
}
示例7: SaveAccounting
public void SaveAccounting(Accounting accounting)
{
using (var dbContext = new ProjectDbContext())
{
if (accounting.ID > 0)
{
dbContext.Update<Accounting>(accounting);
}
else
{
dbContext.Insert<Accounting>(accounting);
}
}
}
示例8: SaveIncome
public void SaveIncome(Income income)
{
using (var dbContext = new ProjectDbContext())
{
if (income.ID > 0)
{
dbContext.Update<Income>(income);
}
else
{
dbContext.Insert<Income>(income);
}
}
}
示例9: SaveOverhead
public void SaveOverhead(Overhead overhead)
{
using (var dbContext = new ProjectDbContext())
{
var budgets = dbContext.Budgets.ToList();
if (overhead.ID>0)
{
if (overhead.OverheadTotal > 0)
{
foreach (var budget in budgets)
{
if (budget.ProjectID == overhead.ProjectID)
{
budget.OverheadID = overhead.ID;
dbContext.Update<BudgetInfo>(budget);
}
}
}
dbContext.Update<Overhead>(overhead);
}
else
{
dbContext.Insert<Overhead>(overhead);
}
}
}
示例10: SaveMeasure
public void SaveMeasure(Measure measure)
{
using (var dbContext = new ProjectDbContext())
{
if (measure.ID >0)
{
var budgets = dbContext.Budgets.ToList();
if (measure.MeasureTotal > 0)
{
foreach (var budget in budgets)
{
if (budget.ProjectID == measure.ProjectID)
{
budget.MeasureID = measure.ID;
dbContext.Update<BudgetInfo>(budget);
}
}
}
dbContext.Update<Measure>(measure);
}
else
{
dbContext.Insert<Measure>(measure);
}
}
}
示例11: SaveMachineryCost
public void SaveMachineryCost(MachineryCost machinerycost)
{
using (var dbContext = new ProjectDbContext())
{
if (machinerycost.ID >0)
{
var budgets = dbContext.Budgets.ToList();
if (machinerycost.MachineryTotal > 0)
{
foreach (var budget in budgets)
{
if (budget.ProjectID == machinerycost.ProjectID)
{
budget.MachineryCostID = machinerycost.ID;
dbContext.Update<BudgetInfo>(budget);
}
}
}
dbContext.Update<MachineryCost>(machinerycost);
}
else
{
dbContext.Insert<MachineryCost>(machinerycost);
}
}
}
示例12: SaveLaborCost
public void SaveLaborCost(LaborCost laborcost)
{
using (var dbContext = new ProjectDbContext())
{
if (laborcost.ID >0)
{
var budgets = dbContext.Budgets.ToList();
if (laborcost.LaborTotal > 0)
{
foreach (var budget in budgets)
{
if (budget.ProjectID == laborcost.ProjectID)
{
budget.LaborCostID = laborcost.ID;
dbContext.Update<BudgetInfo>(budget);
}
}
}
dbContext.Update<LaborCost>(laborcost);
}
else
{
dbContext.Insert<LaborCost>(laborcost);
}
}
}
示例13: SaveOfficeCtrl
public void SaveOfficeCtrl(OfficeCtrl offices)
{
using (var dbContext = new ProjectDbContext())
{
if (offices.ID > 0)
{
dbContext.Update<OfficeCtrl>(offices);
}
else
{
dbContext.Insert<OfficeCtrl>(offices);
}
}
}
示例14: SavePayables
public void SavePayables(Payables pay)
{
using (var dbContext = new ProjectDbContext())
{
if (pay.ID > 0)
{
dbContext.Update<Payables>(pay);
}
else
{
dbContext.Insert<Payables>(pay);
}
}
}
示例15: SaveFile
public void SaveFile(Files file)
{
using (var dbContext = new ProjectDbContext())
{
if (file.ID > 0)
{
dbContext.Update<Files>(file);
}
else
{
dbContext.Insert<Files>(file);
}
}
}