本文整理汇总了C#中GMS.Project.DAL.ProjectDbContext类的典型用法代码示例。如果您正苦于以下问题:C# ProjectDbContext类的具体用法?C# ProjectDbContext怎么用?C# ProjectDbContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProjectDbContext类属于GMS.Project.DAL命名空间,在下文中一共展示了ProjectDbContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: DeleteProjectBasedata
public void DeleteProjectBasedata(List<int> ids)
{
using (var dbContext = new ProjectDbContext())
{
dbContext.ProjectBasedatas.Where(u => ids.Contains(u.ID)).Delete();
}
}
开发者ID:addy002,项目名称:HaoTang,代码行数:7,代码来源:ProjectService.cs
示例2: GetBudget
public BudgetInfo GetBudget(int id)
{
using (var dbContext = new ProjectDbContext())
{
return dbContext.Find<BudgetInfo>(id);
}
}
开发者ID:addy002,项目名称:HaoTang,代码行数:7,代码来源:ProjectService.cs
示例3: GetProjectBasedata
public ProjectBasedata GetProjectBasedata(int id)
{
using (var dbContext = new ProjectDbContext())
{
return dbContext.Find<ProjectBasedata>(id);
}
}
开发者ID:addy002,项目名称:HaoTang,代码行数:7,代码来源:ProjectService.cs
示例4: GetBudgetList
public IEnumerable<BudgetInfo> GetBudgetList(BudgetRequest request = null)
{
request = request ?? new BudgetRequest();
using (var dbContext = new ProjectDbContext())
{
IQueryable<BudgetInfo> Budgets = dbContext.Budgets.Include("LaborCost").Include("Overhead").Include("MachineryCost").Include("MaterialCost").Include("Measure");
if (!string.IsNullOrEmpty(request.ProjectName))
Budgets = Budgets.Where(u => u.ProjectName.Contains(request.ProjectName));
return Budgets.OrderByDescending(u => u.ID).ToPagedList(request.PageIndex, request.PageSize);
}
}
开发者ID:addy002,项目名称:HaoTang,代码行数:11,代码来源:ProjectService.cs
示例5: SaveProjectBasedata
public void SaveProjectBasedata(ProjectBasedata project)
{
using (var dbContext = new ProjectDbContext())
{
if (project.ID>0)
{
dbContext.Update<ProjectBasedata>(project);
}
else
{
dbContext.Insert<ProjectBasedata>(project);
}
}
}
开发者ID:addy002,项目名称:HaoTang,代码行数:15,代码来源:ProjectService.cs
示例6: GetProjectBasedataList
public IEnumerable<ProjectBasedata> GetProjectBasedataList(ProjectRequest request = null)
{
request = request ?? new ProjectRequest();
using (var dbContext = new ProjectDbContext())
{
IQueryable<ProjectBasedata> ProjectBasedatas = dbContext.ProjectBasedatas;
if (!string.IsNullOrEmpty(request.PName))
ProjectBasedatas = ProjectBasedatas.Where(u => u.PName.Contains(request.PName));
if (!string.IsNullOrEmpty(request.Status))
ProjectBasedatas = ProjectBasedatas.Where(u => u.Status.Contains(request.Status));
if (!string.IsNullOrEmpty(request.Fund))
ProjectBasedatas = ProjectBasedatas.Where(u => u.Fund.Contains(request.Fund));
return ProjectBasedatas.OrderByDescending(u => u.ID).ToPagedList(request.PageIndex, request.PageSize);
}
}
开发者ID:addy002,项目名称:HaoTang,代码行数:18,代码来源:ProjectService.cs
示例7: GetInsOverheadList
public IEnumerable<InsOverhead> GetInsOverheadList(InsOverheadRequest request = null)
{
request = request ?? new InsOverheadRequest();
using (var dbContext = new ProjectDbContext())
{
IQueryable<InsOverhead> InsOverhead = dbContext.InsOverheads.Include("ProjectBasedata");
if (request.ProjectBasedataID > 0)
InsOverhead = InsOverhead.Where(d => d.ProjectBasedataID == request.ProjectBasedataID);
return InsOverhead.OrderByDescending(u => u.ID).ToPagedList(request.PageIndex, request.PageSize);
}
}
开发者ID:addy002,项目名称:HaoTang,代码行数:13,代码来源:ProjectService.cs
示例8: GetInsOverhead
public InsOverhead GetInsOverhead(int id)
{
using (var dbContext = new ProjectDbContext())
{
var model = dbContext.Find<InsOverhead>(id);
model.ProjectBasedata = GetProjectBasedata(model.ProjectBasedataID);
return model;
//return dbContext.Find<InsOverhead>(id);
}
}
开发者ID:addy002,项目名称:HaoTang,代码行数:10,代码来源:ProjectService.cs
示例9: GetAccounting
public Accounting GetAccounting(int id)
{
using (var dbContext = new ProjectDbContext())
{
return dbContext.Find<Accounting>(id);
}
}
开发者ID:addy002,项目名称:HaoTang,代码行数:7,代码来源:ProjectService.cs
示例10: GetOddmentsList
public IEnumerable<Oddments> GetOddmentsList(OddmentsRequest request = null)
{
request = request ?? new OddmentsRequest();
using (var dbContext = new ProjectDbContext())
{
IQueryable<Oddments> oddments = dbContext.Oddments;
if (!string.IsNullOrEmpty(request.Name))
oddments = oddments.Where(u => u.Name.Contains(request.Name));
//if (!string.IsNullOrEmpty(request.Toolname))
// oddments = oddments.Where(u => u.Toolname.Contains(request.Toolname));
//if (!string.IsNullOrEmpty(request.obb))
// oddments = oddments.Where(u => u.obb.Contains(request.obb));
//if (!string.IsNullOrEmpty(request.Way))
// oddments = oddments.Where(u => u.Way.Contains(request.Way));
return oddments.OrderByDescending(u => u.ID).ToPagedList(request.PageIndex, request.PageSize);
}
}
开发者ID:addy002,项目名称:HaoTang,代码行数:24,代码来源:ProjectService.cs
示例11: DeleteFile
public void DeleteFile(List<int> ids)
{
using (var dbContext = new ProjectDbContext())
{
dbContext.Files.Where(u => ids.Contains(u.ID)).Delete();
}
}
开发者ID:addy002,项目名称:HaoTang,代码行数:7,代码来源:ProjectService.cs
示例12: GetFileList
public IEnumerable<Files> GetFileList(FileRequest request = null)
{
request = request ?? new FileRequest();
using (var dbContext = new ProjectDbContext())
{
IQueryable<Files> files = dbContext.Files;
if (!string.IsNullOrEmpty(request.Name))
files = files.Where(u => u.Name.Contains(request.Name));
if (!string.IsNullOrEmpty(request.Type))
files = files.Where(u => u.Type.Contains(request.Type));
return files.OrderByDescending(u => u.ID).ToPagedList(request.PageIndex, request.PageSize);
}
}
开发者ID:addy002,项目名称:HaoTang,代码行数:18,代码来源:ProjectService.cs
示例13: DeleteInsOverhead
public void DeleteInsOverhead(List<int> ids)
{
using (var dbContext = new ProjectDbContext())
{
dbContext.InsOverheads.Where(u => ids.Contains(u.ID)).Delete();
}
}
开发者ID:addy002,项目名称:HaoTang,代码行数:7,代码来源:ProjectService.cs
示例14: 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);
}
}
}
开发者ID:addy002,项目名称:HaoTang,代码行数:27,代码来源:ProjectService.cs
示例15: GetInsLaborCostList
public IEnumerable<InsLaborCost> GetInsLaborCostList(InsLaborCostRequest request = null)
{
request = request ?? new InsLaborCostRequest();
using (var dbContext = new ProjectDbContext())
{
IQueryable<InsLaborCost> InsLaborCost = dbContext.InsLaborCosts.Include("ProjectBasedata") ;
//if (!string.IsNullOrEmpty(request.ProjectBasedataID))
if (request.ProjectBasedataID>0)
InsLaborCost = InsLaborCost.Where(d => d.ProjectBasedataID == request.ProjectBasedataID);
return InsLaborCost.OrderByDescending(u => u.ID).ToPagedList(request.PageIndex, request.PageSize);
}
}
开发者ID:addy002,项目名称:HaoTang,代码行数:14,代码来源:ProjectService.cs
示例16: GetInsLaborCost
public InsLaborCost GetInsLaborCost(int id)
{
using (var dbContext = new ProjectDbContext())
{
//dbContext.Find.InsLaborCosts.Where((d => d.ID == id);
//var q = from L in dbContext.InsLaborCosts
// join P in dbContext.ProjectBasedatas on L.ProjectBasedataID equals P.ID
// //orderby n.AddTime descending
// select L;
//return q.ToList();
var model = dbContext.Find<InsLaborCost>(id);
model.ProjectBasedata = GetProjectBasedata(model.ProjectBasedataID);
return model;
}
}
开发者ID:addy002,项目名称:HaoTang,代码行数:19,代码来源:ProjectService.cs
示例17: SaveInsBudget
public void SaveInsBudget(InsBudgetInfo insbudget)
{
using (var dbContext = new ProjectDbContext())
{
if (insbudget.ID > 0)
{
dbContext.Update<InsBudgetInfo>(insbudget);
}
else
{
dbContext.Insert<InsBudgetInfo>(insbudget);
}
}
}
开发者ID:addy002,项目名称:HaoTang,代码行数:15,代码来源:ProjectService.cs
示例18: SaveAccounting
public void SaveAccounting(Accounting accounting)
{
using (var dbContext = new ProjectDbContext())
{
if (accounting.ID > 0)
{
dbContext.Update<Accounting>(accounting);
}
else
{
dbContext.Insert<Accounting>(accounting);
}
}
}
开发者ID:addy002,项目名称:HaoTang,代码行数:16,代码来源:ProjectService.cs
示例19: GetAccountingList
public IEnumerable<Accounting> GetAccountingList(AccountingRequest request = null)
{
request = request ?? new AccountingRequest();
using (var dbContext = new ProjectDbContext())
{
IQueryable<Accounting> Accounting = dbContext.Accountings;
if (!string.IsNullOrEmpty(request.Name))
Accounting = Accounting.Where(u => u.Name.Contains(request.Name));
return Accounting.OrderByDescending(u => u.ID).ToPagedList(request.PageIndex, request.PageSize);
}
}
开发者ID:addy002,项目名称:HaoTang,代码行数:13,代码来源:ProjectService.cs
示例20: 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);
}
}
}
开发者ID:addy002,项目名称:HaoTang,代码行数:27,代码来源:ProjectService.cs
注:本文中的GMS.Project.DAL.ProjectDbContext类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论