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


C# SycousCon.SaveChanges方法代码示例

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


在下文中一共展示了SycousCon.SaveChanges方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateUnOccupiedProperty

        public static Boolean CreateUnOccupiedProperty(UnOccupiedProperty UnOccupied)
        {
            Boolean flag = false;
            if (!(IsExistingUnOccupiedProperty(UnOccupied)))
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    using (var context = new SycousCon())
                    {
                        try
                        {
                            context.UnOccupiedProperties.AddObject(UnOccupied);
                            context.SaveChanges();
                            scope.Complete();
                            context.AcceptAllChanges();
                            flag = true;
                        }
                        catch (Exception ex)
                        {
                            context.Dispose();
                            throw;
                        }
                    }//
                }// using
            }//if

            return flag;
        }
开发者ID:arnabknd4,项目名称:scs0400915,代码行数:28,代码来源:DALUnOccupiedProperty.cs

示例2: CreateDataLoggerMapping

        public static Boolean CreateDataLoggerMapping(SiteInLogger logger)
        {
            Boolean flag = false;

                using (TransactionScope scope = new TransactionScope())
                {
                    using (var context = new SycousCon())
                    {
                        try
                        {
                            context.SiteInLoggers.AddObject(logger);
                            context.SaveChanges();
                            scope.Complete();
                            context.AcceptAllChanges();
                            flag = true;
                        }
                        catch (Exception ex)
                        {
                            context.Dispose();
                            throw;
                        }
                    }//
                }// using

            return flag;
        }
开发者ID:arnabknd4,项目名称:scs0400915,代码行数:26,代码来源:DALDataLogger.cs

示例3: CreatePeerConsumerAverages

        public static Boolean CreatePeerConsumerAverages(PeerNConsumerAverage Peer)
        {
            Boolean flag = false;
            if (!(IsExistingPeerNConsumerAverage(Peer)))
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    using (var context = new SycousCon())
                    {
                        try
                        {
                            context.PeerNConsumerAverages.AddObject(Peer);
                            context.SaveChanges();
                            scope.Complete();
                            context.AcceptAllChanges();
                            flag = true;
                        }
                        catch (Exception ex)
                        {
                            context.Dispose();
                            throw;
                        }
                    }//
                }// using
            }//if

            return flag;
        }
开发者ID:arnabknd4,项目名称:scs0400915,代码行数:28,代码来源:DALPeer.cs

示例4: UpdateExistResetPassword

        public static bool UpdateExistResetPassword(ResetPwd Pwd)
        {
            Boolean flag = true;
            using (TransactionScope scope = new TransactionScope())
            {
                using (var context = new SycousCon())
                {
                    try
                    {
                        var ResetToUpdate = context.ResetPwds.Where(c => c.UserID == Pwd.UserID && c.Active == false);
                        foreach (ResetPwd p in ResetToUpdate)
                        {
                            p.Active = true;
                            p.ModifyBy = Pwd.CreateBy;
                            p.ModifyDate = DateTime.Now;
                        }

                        context.SaveChanges();
                        context.AcceptAllChanges();
                        scope.Complete();
                        context.Dispose();
                        flag = true;
                    }
                    catch (Exception ex)
                    {
                        flag = false;
                        context.Dispose();
                        throw;
                    }
                }
            }
            return flag;
        }
开发者ID:arnabknd4,项目名称:scs2300915,代码行数:33,代码来源:DALUserReg.cs

示例5: CreateSiteCreditControl

        public static Boolean CreateSiteCreditControl(SiteCreditControl site)
        {
            Boolean flag = false;
            if (!(IsExistingSiteCreditControl(site)))
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    using (var context = new SycousCon())
                    {
                        try
                        {
                            context.SiteCreditControls.AddObject(site);
                            context.SaveChanges();
                            scope.Complete();
                            context.AcceptAllChanges();
                            flag = true;
                        }
                        catch (Exception ex)
                        {
                            context.Dispose();
                            throw;
                        }
                    }//
                }// using
            }//if

            return flag;
        }
开发者ID:arnabknd4,项目名称:scs0400915,代码行数:28,代码来源:DALCreditControl.cs

示例6: DeletedDirectDebit

        public static Boolean DeletedDirectDebit(DirectDebit debit)
        {
            using (TransactionScope scope = new TransactionScope())
            {
                Boolean bol = false;
                using (var context = new SycousCon())
                {
                    try
                    {
                        var Update = context.DirectDebits.Where(c => c.ID == debit.ID&& c.IsDeleted==0&&c.IsApproved==0);

                        foreach (DirectDebit p in Update)
                        {
                            p.IsDeleted = 2;
                            p.ModifyBy = debit.ModifyBy;
                            p.ModifyDate = DateTime.Now;

                        }//
                        context.SaveChanges();
                        context.AcceptAllChanges();
                        scope.Complete();
                        context.Dispose();
                        bol = true;
                    }
                    catch (Exception ex)
                    {
                        context.Dispose();
                        throw;
                    }

                }// using
                return bol;
            } //trans
        }
开发者ID:arnabknd4,项目名称:scs0400915,代码行数:34,代码来源:DALDirectDebit.cs

示例7: CreateDirectDebitTLetteremplate

 public static Boolean CreateDirectDebitTLetteremplate(DirectDebitLetterTemplate directDebit)
 {
     Boolean flag = false;
     if (!(IsExistingDirectDebitTemplate(directDebit)))
     {
         using (TransactionScope scope = new TransactionScope())
         {
             using (var context = new SycousCon())
             {
                 try
                 {
                     context.DirectDebitLetterTemplates.AddObject(directDebit);
                     context.SaveChanges();
                     scope.Complete();
                     context.AcceptAllChanges();
                     flag = true;
                 }
                 catch (Exception ex)
                 {
                     context.Dispose();
                     throw;
                 }
             }
         }
     }
     return flag;
 }
开发者ID:arnabknd4,项目名称:scs2300915,代码行数:27,代码来源:DALDirectDebitTemplate.cs

示例8: CreateDepartment

 public static Boolean CreateDepartment(Department deptartment)
 {
     Boolean flag = false;
     using (TransactionScope scope = new TransactionScope())
     {
         if (!(IsExistingDeptarmentCode(deptartment.DeptCode)))
         {
             using (var context = new SycousCon())
             {
                 try
                 {
                     context.Departments.AddObject(deptartment);
                     context.SaveChanges();
                     scope.Complete();
                     context.AcceptAllChanges();
                     flag = true;
                 }
                 catch (Exception ex)
                 {
                     context.Dispose();
                     throw;
                 }
             }
         }
     }
     return flag;
 }
开发者ID:arnabknd4,项目名称:scs0400915,代码行数:27,代码来源:DALDept.cs

示例9: CreateResetPassword

        public static Boolean CreateResetPassword(ResetPwd Pwd)
        {
            Boolean flag = false;

            if (UpdateExistResetPassword(Pwd))
            {

                using (TransactionScope scope = new TransactionScope())
                {
                    using (var context = new SycousCon())
                    {
                        try
                        {
                            context.ResetPwds.AddObject(Pwd);
                            context.SaveChanges();
                            scope.Complete();
                            context.AcceptAllChanges();
                            flag = true;
                        }
                        catch (Exception ex)
                        {
                            context.Dispose();
                            throw;
                        }
                    }
                }
            }
            return flag;
        }
开发者ID:arnabknd4,项目名称:scs2300915,代码行数:29,代码来源:DALUserReg.cs

示例10: CreatePropertyBandInTariff

 public static Boolean CreatePropertyBandInTariff(PropertyBandInTariff tariff)
 {
     Boolean flag = false;
        if ((IsExistingPropertyBandInTariff(tariff)))
        {
        using (TransactionScope scope = new TransactionScope())
        {
            using (var context = new SycousCon())
            {
                try
                {
                    context.PropertyBandInTariffs.AddObject(tariff);
                    context.SaveChanges();
                    scope.Complete();
                    context.AcceptAllChanges();
                    flag = true;
                }
                catch (Exception ex)
                {
                    context.Dispose();
                    throw;
                }
            }
        }
        }
        return flag;
 }
开发者ID:arnabknd4,项目名称:scs0400915,代码行数:27,代码来源:DALTariff.cs

示例11: AddTariffProperty

        public static Boolean AddTariffProperty(List<DAL.TariffInProperty> tariff)
        {
            Boolean flag = false;
               using (TransactionScope scope = new TransactionScope())
               {
               using (var context = new SycousCon())
               {
                   try
                   {
                       foreach (DAL.TariffInProperty item in tariff)
                       {
                           context.TariffInProperties.AddObject(item);

                       }
                       context.SaveChanges();
                       context.AcceptAllChanges();
                       scope.Complete();
                       flag = true;
                   }
                   catch (Exception ex)
                   {
                       context.Dispose();
                       throw;
                   }
               }// using
               return flag;
               }// trans
        }
开发者ID:arnabknd4,项目名称:scs0400915,代码行数:28,代码来源:DALProperty.cs

示例12: CreateTemperatureDifference

        public static Boolean CreateTemperatureDifference(TemperatureDifference Temperature)
        {
            Boolean flag = false;
            if (!(IsExistingTemperatureDifference(Temperature)))
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    using (var context = new SycousCon())
                    {
                        try
                        {
                            context.TemperatureDifferences.AddObject(Temperature);
                            context.SaveChanges();
                            scope.Complete();
                            context.AcceptAllChanges();
                            flag = true;
                        }
                        catch (Exception ex)
                        {
                            context.Dispose();
                            throw;
                        }
                    }//
                }// using
            }//if

            return flag;
        }
开发者ID:arnabknd4,项目名称:scs0400915,代码行数:28,代码来源:DALTemperature.cs

示例13: CreateEnergy

        public static Boolean CreateEnergy(Energy energy)
        {
            Boolean flag = false;
              if (!(IsExistingEnergy(energy)))
              {
              using (TransactionScope scope = new TransactionScope())
              {
                  using (var context = new SycousCon())
                  {
                      try
                      {
                          context.Energies.AddObject(energy);
                          context.SaveChanges();
                          scope.Complete();
                          context.AcceptAllChanges();
                          flag = true;
                      }
                      catch (Exception ex)
                      {
                          context.Dispose();
                          throw;
                      }
                  }//
              }// using
              }//if

              return flag;
        }
开发者ID:arnabknd4,项目名称:scs0400915,代码行数:28,代码来源:DALEnergy.cs

示例14: CreateDirectDebit

        public static Boolean CreateDirectDebit(DirectDebit mdirectdebit)
        {
            Boolean flag = false;

                using (TransactionScope scope = new TransactionScope())
                {
                    using (var context = new SycousCon())
                    {
                        try
                        {
                            context.DirectDebits.AddObject(mdirectdebit);
                            context.SaveChanges();
                            scope.Complete();
                            context.AcceptAllChanges();
                            flag = true;
                        }
                        catch (Exception ex)
                        {
                            context.Dispose();
                            throw;
                        }
                    }
                }

            return flag;
        }
开发者ID:arnabknd4,项目名称:scs0400915,代码行数:26,代码来源:DALDirectDebit.cs

示例15: CreateUnit

 public static Boolean CreateUnit(UnitMaster unit)
 {
     Boolean flag = false;
     if (!(IsExistingUnit(unit)))
     {
         using (TransactionScope scope = new TransactionScope())
         {
             using (var context = new SycousCon())
             {
                 try
                 {
                     context.UnitMasters.AddObject(unit);
                     context.SaveChanges();
                     scope.Complete();
                     context.AcceptAllChanges();
                     flag = true;
                 }
                 catch (Exception ex)
                 {
                     context.Dispose();
                     throw;
                 }
             }
         }
     }
     return flag;
 }
开发者ID:arnabknd4,项目名称:sycos_latest,代码行数:27,代码来源:DALUnit.cs


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