示例#1
0
        public Result FinishTraing(Training _training)
        {
            Result result = new Result();

            if (getCurrentUser() == null)
            {
                result.Message = "Session Expired !! Please reload Page ";
            }
            else
            {
                Training training = itraining.GetTraining(_training.tr_id);
                if (training != null)
                {
                    if (_training.tr_end_date >= training.tr_start_date)
                    {
                        training.tr_end_date = _training.tr_end_date;
                        itraining.Update(training);

                        result.Message = "Success";
                    }
                    else
                    {
                        result.Message = "End Date Should be greater than Start date ";
                    }
                }
                else
                {
                    result.Message = "Data Not Found!!!";
                }
            }
            return(result);
        }
 public IHttpActionResult Put(Training item)
 {
     try
     {
         training.Update(new Training {
             ID   = item.ID, StartDate = item.StartDate, EndDate = item.EndDate,
             Cost = item.Cost, RegistrationClosingDate = item.RegistrationClosingDate, VenueID = item.VenueID
         });
         return(Redirect("Index"));
     }
     catch
     {
         return(Ok());
     }
 }