public void Create(Category Category,System.Web.HttpContextBase HttpContext) { string ID = HttpContext.User.Identity.GetUserId(); var qu = from b in _db.Users where b.Id == ID select b; _db.CategoryDb.Add(Category = new Category() { Id = Category.Id, Title = Category.Title, NumberofMoney = Category.NumberofMoney, ApplicationUser = qu.ToList()[0] }); }
public IEnumerable<Subcategory> GetAllSubcategory(Category cat) { var qu = from b in _db.SubcategoryDb where b.CategoryId == cat.Id select b; return qu.ToList(); }
public void Update(Category Category) { _db.Entry(Category).State = EntityState.Modified; }
public IEnumerable<Subcategory> GetAll(System.Web.HttpContextBase http,Category category) { string ID = http.User.Identity.GetUserId(); var qu = from b in db.SubcategoryDb where b.CategoryId == category.Id && category.ApplicationUser.Id ==ID select b; return qu.ToList(); }
public void TotalToCategoryTransThowTheCat(HttpContextBase http, Category category,decimal res) { string id = http.User.Identity.GetUserId(); ApplicationUser user = _db.Users.Find(id); Category categoryForTrans = _db.CategoryDb.Find(category.Id); category.NumberofMoney += res; user.TotalMoney -= res; }
public void TotalToCategoryTransaction(HttpContextBase http, Category category) { string id= http.User.Identity.GetUserId(); ApplicationUser user = _db.Users.Find(id); Category categoryForTrans = _db.CategoryDb.Find(category.Id); user.TotalMoney -= categoryForTrans.NumberofMoney; }
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; }