public bool Add(InventoryOutsType _InventoryOutsType)
 {
     try
     {
         _InventoryOutsType.CreatedDate     = DateTime.Now;
         _InventoryOutsType.CreatedByUserId = DatabaseTools.GetUserID;
         contaxt.InventoryOutsTypes.Add(_InventoryOutsType);
         contaxt.SaveChanges();
         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);
 }
 public bool Update(InventoryOutsType _InventoryOutsType)
 {
     try
     {
         var _contaxt = contaxt.InventoryOutsTypes
                        .Where(p => p.InventoryOutsTypeId == _InventoryOutsType.InventoryOutsTypeId).FirstOrDefault();
         _contaxt.InventoryOutsTypeId = _InventoryOutsType.InventoryOutsTypeId;
         _contaxt.Title           = _InventoryOutsType.Title;
         _contaxt.Description     = _InventoryOutsType.Description;
         _contaxt.ChangedDate     = DateTime.Now;
         _contaxt.ChangedByUserId = DatabaseTools.GetUserID;
         contaxt.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }