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


C# ProjectDbContext.Insert方法代码示例

本文整理汇总了C#中GMS.Project.DAL.ProjectDbContext.Insert方法的典型用法代码示例。如果您正苦于以下问题:C# ProjectDbContext.Insert方法的具体用法?C# ProjectDbContext.Insert怎么用?C# ProjectDbContext.Insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GMS.Project.DAL.ProjectDbContext的用法示例。


在下文中一共展示了ProjectDbContext.Insert方法的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);
                }
            }
        }
开发者ID:addy002,项目名称:HaoTang,代码行数:15,代码来源:ProjectService.cs

示例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);
                }
            }
        }
开发者ID:addy002,项目名称:HaoTang,代码行数:15,代码来源:ProjectService.cs

示例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);
                }
            }
        }
开发者ID:addy002,项目名称:HaoTang,代码行数:27,代码来源:ProjectService.cs

示例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);
                }
            }
        }
开发者ID:addy002,项目名称:HaoTang,代码行数:27,代码来源:ProjectService.cs

示例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);
                }
            }
        }
开发者ID:addy002,项目名称:HaoTang,代码行数:27,代码来源:ProjectService.cs

示例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);
                }
            }
        }
开发者ID:addy002,项目名称:HaoTang,代码行数:15,代码来源:ProjectService.cs

示例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);
                }
            }
        }
开发者ID:addy002,项目名称:HaoTang,代码行数:16,代码来源:ProjectService.cs

示例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);
                }
            }
        }
开发者ID:shenxingfu,项目名称:HaoTang,代码行数:16,代码来源:ProjectService.cs

示例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);
                }
            }
        }
开发者ID:addy002,项目名称:HaoTang,代码行数:27,代码来源:ProjectService.cs

示例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);
                }
            }
        }
开发者ID:addy002,项目名称:HaoTang,代码行数:27,代码来源:ProjectService.cs

示例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);
                }
            }
        }
开发者ID:addy002,项目名称:HaoTang,代码行数:27,代码来源:ProjectService.cs

示例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);
                }
            }
        }
开发者ID:addy002,项目名称:HaoTang,代码行数:29,代码来源:ProjectService.cs

示例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);
         }
     }
 }
开发者ID:addy002,项目名称:HaoTang,代码行数:14,代码来源:ProjectService.cs

示例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);
                }
            }
        }
开发者ID:shenxingfu,项目名称:HaoTang,代码行数:16,代码来源:ProjectService.cs

示例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);
         }
     }
 }
开发者ID:addy002,项目名称:HaoTang,代码行数:14,代码来源:ProjectService.cs


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