Example #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();
             }
         }
     }
 }
Example #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>());
     }
 }
Example #3
0
 /// <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>());
     }
 }
Example #4
0
 public ModuleButtonRepository(NFineDbContext dbContext, IRepositoryBase repositoryBase) : base(dbContext)
 {
     this.repositoryBase = repositoryBase;
 }
 public ItemsDetailRepository(NFineDbContext dbContext) : base(dbContext)
 {
 }
 public UserRepository(NFineDbContext dbContext, IRepositoryBase repositoryBase) : base(dbContext)
 {
     this.repositoryBase = repositoryBase;
 }
Example #7
0
 public FilterIPRepository(NFineDbContext dbContext) : base(dbContext)
 {
 }
Example #8
0
 public OrganizeRepository(NFineDbContext dbContext) : base(dbContext)
 {
 }
Example #9
0
 public ModuleRepository(NFineDbContext dbContext) : base(dbContext)
 {
 }
Example #10
0
 public UserLogOnRepository(NFineDbContext dbContext) : base(dbContext)
 {
 }
 public RoleAuthorizeRepository(NFineDbContext dbContext) : base(dbContext)
 {
 }
 public AreaRepository(NFineDbContext dbContext) : base(dbContext)
 {
 }
 public NewsInfoRepository(NFineDbContext dbContext) : base(dbContext)
 {
 }
Example #14
0
 public LogRepository(NFineDbContext dbContext) : base(dbContext)
 {
 }