示例#1
0
 public IHttpActionResult Post(int Id, int workoutid, string comments, string enddate, string endtime)
 {
     try
     {
         enddate = enddate.Replace("_", "/");
         endtime = endtime.Replace("_", ":");
         WorkOutDBLayer.Model.Workout_Active model = new WorkOutDBLayer.Model.Workout_Active()
         {
             Comment   = comments,
             End_Date  = Convert.ToDateTime(enddate),
             End_time  = endtime,
             Status    = true,
             Id        = Id,
             WorkOutId = workoutid
         };
         if (dao.AddStartWorkOut(model))
         {
             return(Ok("Record Saved Successfully"));
         }
         else
         {
             return(BadRequest("Error Occurred"));
         }
     }
     catch (Exception ex)
     {
         return(BadRequest("Error Occurred"));
     }
 }
示例#2
0
 public IHttpActionResult Post(int Id, string comments, string startdate, string starttime)
 {
     try
     {
         startdate = startdate.Replace("_", "/");
         starttime = starttime.Replace("_", ":");
         WorkOutDBLayer.Model.Workout_Active model = new WorkOutDBLayer.Model.Workout_Active()
         {
             Comment    = comments,
             Start_Date = Convert.ToDateTime(startdate),
             Start_Time = starttime,
             Status     = true,
             WorkOutId  = Id
         };
         if (dao.AddStartWorkOut(model))
         {
             return(Ok("Record Created Successfully"));
         }
         else
         {
             return(BadRequest("Error Occurred"));
         }
     }
     catch (Exception ex)
     {
         return(BadRequest("Error Occurred"));
     }
 }