public void CreateUmp(Subcategory Subcategory,System.Web.HttpContextBase http) { db.SubcategoryDb.Add(Subcategory = new Subcategory() { Id = Subcategory.Id, Title = Subcategory.Title, Value = Subcategory.Value, Date = DateTime.Now, CategoryId = Subcategory.CategoryId, }); db.SubcategoryDb.Add(Subcategory); }
public void CreateImp(Subcategory Subcategory, System.Web.HttpContextBase http) { db.SubcategoryDb.Add(Subcategory = new Subcategory() { Id = Subcategory.Id, Title = Subcategory.Title, Value = -Subcategory.Value, Date = DateTime.Now, CategoryId = Subcategory.CategoryId, //UserId = http.User.Identity.GetUserId() }); db.SubcategoryDb.Add(Subcategory); }
public void Update(Subcategory Subcategory) { db.Entry(Subcategory).State = EntityState.Modified; }
public void CategoryToSubTransactionRemove(HttpContextBase http, Category category, Subcategory subcategory) { string id = http.User.Identity.GetUserId(); Category categoryForTrans = _db.CategoryDb.Find(category.Id); category.NumberofMoney += subcategory.Value; }