コード例 #1
0
 public void SubmitForm(ItemMasterEntity itemMaster, List <ItemMasterPicEntity> itemMasterPic, string keyValue)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         //db.Update(itemMaster);
     }
     else
     {
         using (NFineDbContext db = new NFineDbContext())
         {
             using (TransactionScope trans = new TransactionScope())
             {
                 db.Entry <ItemMasterEntity>(itemMaster).State = EntityState.Added;
                 db.SaveChanges();
                 foreach (ItemMasterPicEntity item in itemMasterPic)
                 {
                     item.F_ItemMaster = itemMaster.F_Id;
                     db.Entry <ItemMasterPicEntity>(item).State = EntityState.Added;
                 }
                 db.SaveChanges();
                 trans.Complete();
             }
         }
     }
 }
コード例 #2
0
 private void PreApplicationStartMethod()
 {
     using (var dbcontext = new NFineDbContext())
     {
         var objectContext     = ((IObjectContextAdapter)dbcontext).ObjectContext;
         var mappingCollection = (StorageMappingItemCollection)objectContext.MetadataWorkspace.GetItemCollection(DataSpace.CSSpace);
         mappingCollection.GenerateViews(new List <EdmSchemaError>());
     }
 }
コード例 #3
0
ファイル: Global.asax.cs プロジェクト: iceforkk/CRM
 /// <summary>
 /// 启动应用程序
 /// </summary>
 protected void Application_Start()
 {
     AreaRegistration.RegisterAllAreas();
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     using (var dbcontext = new NFineDbContext())
     {
         var objectContext     = ((IObjectContextAdapter)dbcontext).ObjectContext;
         var mappingCollection = (StorageMappingItemCollection)objectContext.MetadataWorkspace.GetItemCollection(DataSpace.CSSpace);
         mappingCollection.GenerateViews(new List <EdmSchemaError>());
     }
 }
コード例 #4
0
 public ModuleButtonRepository(NFineDbContext dbContext, IRepositoryBase repositoryBase) : base(dbContext)
 {
     this.repositoryBase = repositoryBase;
 }
コード例 #5
0
 public ItemsDetailRepository(NFineDbContext dbContext) : base(dbContext)
 {
 }
コード例 #6
0
 public UserRepository(NFineDbContext dbContext, IRepositoryBase repositoryBase) : base(dbContext)
 {
     this.repositoryBase = repositoryBase;
 }
コード例 #7
0
 public FilterIPRepository(NFineDbContext dbContext) : base(dbContext)
 {
 }
コード例 #8
0
 public OrganizeRepository(NFineDbContext dbContext) : base(dbContext)
 {
 }
コード例 #9
0
 public ModuleRepository(NFineDbContext dbContext) : base(dbContext)
 {
 }
コード例 #10
0
 public UserLogOnRepository(NFineDbContext dbContext) : base(dbContext)
 {
 }
コード例 #11
0
 public RoleAuthorizeRepository(NFineDbContext dbContext) : base(dbContext)
 {
 }
コード例 #12
0
 public AreaRepository(NFineDbContext dbContext) : base(dbContext)
 {
 }
コード例 #13
0
 public NewsInfoRepository(NFineDbContext dbContext) : base(dbContext)
 {
 }
コード例 #14
0
 public LogRepository(NFineDbContext dbContext) : base(dbContext)
 {
 }