/// <summary> /// Adds receipt path /// </summary> /// <param name="id"></param> /// <param name="path"></param> /// <returns></returns> public int AddReceiptPath(int id, string path) { ShoeTrackerSqlStatment statement = new ShoeTrackerSqlStatment(StoredProcedureConstants.AddReceiptPath); statement.AddParameter("Id", id); statement.AddParameter("path", path); return(shoeTrackerDatabase.ExecuteStoredProced(statement)); }
/// <summary> /// Get shoe by child name /// </summary> /// <param name="childName"></param> /// <returns></returns> public List <ShoeTrackerDto> GetShoesByChildName(string childName) { ShoeTrackerSqlStatment statment = new ShoeTrackerSqlStatment(StoredProcedureConstants.GetShoeByChildName); statment.AddParameter("ChildName", childName); return(shoeTrackerDatabase.ExecuteStoredProc(statment, MapShoeAndDescription).ToList()); }
/// <summary> /// Deletes a shoe /// </summary> /// <param name="id"></param> public int DeleteShoe(int id) { ShoeTrackerSqlStatment statment = new ShoeTrackerSqlStatment(StoredProcedureConstants.DeleteShoe); statment.AddParameter("Id", id); return(shoeTrackerDatabase.ExecuteStoredProced(statment)); }
/// <summary> /// get path /// </summary> /// <param name="id"></param> /// <returns></returns> public List <string> GetReceiptPath(int id) { ShoeTrackerSqlStatment statment = new ShoeTrackerSqlStatment(StoredProcedureConstants.GetReceiptPath); statment.AddParameter("Id", id); List <string> path = shoeTrackerDatabase.ExecuteStoredProc(statment, MapReceiptPath).ToList(); return(path); }
/// <summary> /// Gets shoe by id /// </summary> /// <param name="id"></param> /// <returns></returns> public List <ShoeTrackerDto> GetShoeById(int id) { ShoeTrackerSqlStatment statment = new ShoeTrackerSqlStatment(StoredProcedureConstants.GetShoeById); statment.AddParameter("Id", id); List <ShoeTrackerDto> shoeTracker = shoeTrackerDatabase.ExecuteStoredProc(statment, MapShoe).ToList(); return(shoeTracker); }
/// <summary> /// insert budget /// </summary> /// <param name="food"></param> /// <param name="gas"></param> /// <param name="shopping"></param> /// <returns></returns> public int InsertMonthlyBudget(string category, int amount) { ShoeTrackerSqlStatment statment = new ShoeTrackerSqlStatment(StoredProcedureConstants.InsertMonthlyBudget); category = category.ToLower(); if (category == "food") { statment.AddParameter("food", amount); } else if (category == "gas") { statment.AddParameter("gas", amount); } else { statment.AddParameter("shopping", amount); } int scalar = shoeTrackerDatabase.ExecuteStoredProced(statment); return(scalar); }
/// <summary> /// edit shoe /// </summary> /// <param name="shoeTrackerDto"></param> /// <returns></returns> public int EditShoe(ShoeTrackerDto shoeTrackerDto) { ShoeTrackerSqlStatment statement = new ShoeTrackerSqlStatment(StoredProcedureConstants.EditShoe); statement.AddParameter("ShoeTypeId", shoeTrackerDto.ShoeTypeId); statement.AddParameter("Date", shoeTrackerDto.Date); statement.AddParameter("Childname", shoeTrackerDto.ChildName); statement.AddParameter("Price", shoeTrackerDto.Price); statement.AddParameter("Size", shoeTrackerDto.Size); statement.AddParameter("Link", shoeTrackerDto.Link); statement.AddParameter("Id", shoeTrackerDto.Id); return(shoeTrackerDatabase.ExecuteStoredProced(statement)); }