本文整理汇总了C#中GMS.Project.DAL.ProjectDbContext类的典型用法代码示例。如果您正苦于以下问题:C# ProjectDbContext类的具体用法?C# ProjectDbContext怎么用?C# ProjectDbContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProjectDbContext类属于GMS.Project.DAL命名空间,在下文中一共展示了ProjectDbContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteProjectBasedata
public void DeleteProjectBasedata(List<int> ids)
{
using (var dbContext = new ProjectDbContext())
{
dbContext.ProjectBasedatas.Where(u => ids.Contains(u.ID)).Delete();
}
}
示例2: GetBudget
public BudgetInfo GetBudget(int id)
{
using (var dbContext = new ProjectDbContext())
{
return dbContext.Find<BudgetInfo>(id);
}
}
示例3: GetProjectBasedata
public ProjectBasedata GetProjectBasedata(int id)
{
using (var dbContext = new ProjectDbContext())
{
return dbContext.Find<ProjectBasedata>(id);
}
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例9: GetAccounting
public Accounting GetAccounting(int id)
{
using (var dbContext = new ProjectDbContext())
{
return dbContext.Find<Accounting>(id);
}
}
示例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);
}
}
示例11: DeleteFile
public void DeleteFile(List<int> ids)
{
using (var dbContext = new ProjectDbContext())
{
dbContext.Files.Where(u => ids.Contains(u.ID)).Delete();
}
}
示例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);
}
}
示例13: DeleteInsOverhead
public void DeleteInsOverhead(List<int> ids)
{
using (var dbContext = new ProjectDbContext())
{
dbContext.InsOverheads.Where(u => ids.Contains(u.ID)).Delete();
}
}
示例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);
}
}
}
示例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);
}
}