public void SaveProjectBasedata(ProjectBasedata project) { using (var dbContext = new ProjectDbContext()) { if (project.ID>0) { dbContext.Update<ProjectBasedata>(project); } else { dbContext.Insert<ProjectBasedata>(project); } } }
public void SaveBudget(BudgetInfo budget) { using (var dbContext = new ProjectDbContext()) { if (budget.ID >0) { dbContext.Update<BudgetInfo>(budget); } else { dbContext.Insert<BudgetInfo>(budget); } } }
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); } } }
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); } } }
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); } } }
public void SaveInsBudget(InsBudgetInfo insbudget) { using (var dbContext = new ProjectDbContext()) { if (insbudget.ID > 0) { dbContext.Update<InsBudgetInfo>(insbudget); } else { dbContext.Insert<InsBudgetInfo>(insbudget); } } }
public void SaveAccounting(Accounting accounting) { using (var dbContext = new ProjectDbContext()) { if (accounting.ID > 0) { dbContext.Update<Accounting>(accounting); } else { dbContext.Insert<Accounting>(accounting); } } }
public void SaveIncome(Income income) { using (var dbContext = new ProjectDbContext()) { if (income.ID > 0) { dbContext.Update<Income>(income); } else { dbContext.Insert<Income>(income); } } }
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); } } }
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); } } }
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); } } }
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); } } }
public void SaveOfficeCtrl(OfficeCtrl offices) { using (var dbContext = new ProjectDbContext()) { if (offices.ID > 0) { dbContext.Update<OfficeCtrl>(offices); } else { dbContext.Insert<OfficeCtrl>(offices); } } }
public void SavePayables(Payables pay) { using (var dbContext = new ProjectDbContext()) { if (pay.ID > 0) { dbContext.Update<Payables>(pay); } else { dbContext.Insert<Payables>(pay); } } }
public void SaveFile(Files file) { using (var dbContext = new ProjectDbContext()) { if (file.ID > 0) { dbContext.Update<Files>(file); } else { dbContext.Insert<Files>(file); } } }
public void SaveOddments(Oddments oddments) { using (var dbContext = new ProjectDbContext()) { if (oddments.ID > 0) { dbContext.Update<Oddments>(oddments); } else { dbContext.Insert<Oddments>(oddments); } } }
public void SaveOdder(Odder project) { using (var dbContext = new ProjectDbContext()) { if (project.ID > 0) { dbContext.Update<Odder>(project); } else { dbContext.Insert<Odder>(project); } } }