public string Post([FromBody]Competition cmpt)
 {
     DBservices dbs = new DBservices();
     int return_val = 0;
     LogFiles lf = new LogFiles();
     List<Object> mlist = new List<Object>();
     mlist.Add(cmpt);
     try
     {
         return_val = dbs.InsertDatabase(mlist);
     }
     catch (Exception ex)
     {
         string Response = ("Error updating the Competition database " + ex.Message);
         lf.Main("Competition", Response);
         return "Error";
     }
     if (return_val == 0) { return "Error"; }
     return "Success";
 }
示例#2
0
 public string updateDB([FromBody]Routes rut)
 {
     DBservices dbs = new DBservices();
     int return_val = 0;
     LogFiles lf = new LogFiles();
     List<Object> mlist = new List<Object>();
     mlist.Add(rut);
     try
     {
         return_val = dbs.InsertDatabase(mlist);
     }
     catch (Exception ex)
     {
         string Response = ("Error while trying to INSERT the new Route to the database " + ex.Message);
         lf.Main("Routes", Response);
         return "Error";
     }
     if (return_val == 0) { return "Error"; }
     return "Success";
 }
示例#3
0
 public string updateDB([FromBody]Rides rds)
 {
     LogFiles lf = new LogFiles();
     if (DateTime.Now.Day.CompareTo(Convert.ToDateTime(rds.RideDate).Day) < 0 || DateTime.Now.Month.CompareTo(Convert.ToDateTime(rds.RideDate).Month) != 0) { lf.Main("Rides", "The Ride Date:" + rds.RideDate + " Can't be in the future or in a diffetent month "); return "Error"; }
     int return_val = 0;
     DBservices dbs = new DBservices();
     List<Object> mlist = new List<Object>();
     mlist.Add(rds);
     try
     {
         return_val = dbs.InsertDatabase(mlist);
     }
     catch (Exception ex)
     {
         string Response = ("Error while trying to INSERT the new Ride to the database " + ex.Message);
         lf.Main("Rides", Response);
         return "Error";
     }
     if (return_val == 0) { return "Error"; }
     return "Success";
 }
示例#4
0
 public string updateDB([FromBody]Group grp)
 {
     DBservices dbs = new DBservices();
     int return_val = 0;
     LogFiles lf = new LogFiles();
     List<Object> mlist = new List<Object>();
     mlist.Add(grp);
     try
     {
         return_val = dbs.InsertDatabase(mlist);
     }
     catch (Exception ex)
     {
         string Response = ("Error updating the Group database " + ex.Message);
         lf.Main("Groups", Response);
         return "Error";
     }
     if (return_val == 0) { return "Error"; }
     return "Success";
 }