public bool Delete(InventoryInsDeatil _InventoryInsDeatil) { try { var _contaxt = contaxt.InventoryInsDeatils.Remove(_InventoryInsDeatil); contaxt.SaveChanges(); return(true); } catch { return(false); } }
public bool Add(InventoryInsDeatil _InventoryInsDeatil) { try { contaxt.InventoryInsDeatils.Add(_InventoryInsDeatil); contaxt.SaveChanges(); return(true); } catch { return(false); } }
public bool Update(InventoryInsDeatil _InventoryInsDeatil) { try { var _contaxt = contaxt.InventoryInsDeatils.First(p => p.InventoryInsHeaderId == _InventoryInsDeatil.InventoryInsHeaderId & p.ProductId == _InventoryInsDeatil.ProductId); _contaxt.Amount = _InventoryInsDeatil.Amount; _contaxt = _InventoryInsDeatil; return(true); } catch { return(false); } }
protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Configurations.Add(User.Map()); modelBuilder.Configurations.Add(Role.Map()); modelBuilder.Configurations.Add(Corporation.Map()); modelBuilder.Configurations.Add(Product.Map()); modelBuilder.Configurations.Add(Entities.ProductUnit.Map()); modelBuilder.Configurations.Add(ProductCategory.Map()); modelBuilder.Configurations.Add(InventoryInsType.Map()); modelBuilder.Configurations.Add(InventoryInsHeader.Map()); modelBuilder.Configurations.Add(InventoryInsDeatil.Map()); modelBuilder.Configurations.Add(InventoryOutsType.Map()); modelBuilder.Configurations.Add(InventoryOutsHeader.Map()); modelBuilder.Configurations.Add(InventoryOutsDeatil.Map()); modelBuilder.Configurations.Add(ProductParameterValue.Map()); modelBuilder.Configurations.Add(ProductParameter.Map()); base.OnModelCreating(modelBuilder); }