当前位置: 首页>>代码示例>>C#>>正文


C# DAL.ProjectDbContext类代码示例

本文整理汇总了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();
     }
 }
开发者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


注:本文中的GMS.Project.DAL.ProjectDbContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。