/// <summary>
        /// Update shoe
        /// </summary>
        /// <param name="shoeTrackerDto"></param>
        /// <returns></returns>
        public JsonResult UpdateShoe(ShoeTrackerDto shoeTrackerDto)
        {
            int    id      = commandDispatcher.Dispatch(new EditShoeCommand(shoeTrackerDto));
            string message = "Your infomration has been updated";

            return(Json(id, message, JsonRequestBehavior.AllowGet));
        }
        /// <summary>
        /// Adds a shoe to the db
        /// </summary>
        /// <param name="shoeTrackerDto"></param>
        public int AddShoe(ShoeTrackerDto shoeTrackerDto)
        {
            ShoeTrackerSqlStatment statement = new ShoeTrackerSqlStatment(StoredProcedureConstants.AddShoeProductStoredProcedure);

            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);
            return(shoeTrackerDatabase.ExecuteStoredProced(statement));
        }
        public JsonResult AddShoe(ShoeTrackerDto model)
        {
            if (model.Date == DateTime.MinValue)
            {
                model.Date = DateTime.Now;
            }

            AddShoeCommand command = new AddShoeCommand(model);
            int            id      = commandDispatcher.Dispatch(command);

            return(Json(id, JsonRequestBehavior.AllowGet));
        }
Exemple #4
0
 /// <summary>
 /// constructor
 /// </summary>
 /// <param name="shoeTrackerDto"></param>
 public AddShoeCommand(ShoeTrackerDto shoeTrackerDto)
 {
     ShoeTrackerDto = shoeTrackerDto;
 }
Exemple #5
0
 /// <summary>
 /// const
 /// </summary>
 /// <param name="shoeTrackerDto"></param>
 public EditShoeCommand(ShoeTrackerDto shoeTrackerDto)
 {
     ShoeTrackerDto = shoeTrackerDto;
 }