コード例 #1
0
 public List <rainbow> GetList(int user_id)
 {
     try
     {
         Rainbow_manager rainbow = new Rainbow_manager();
         return(rainbow.getall_rainbow(user_id));
     }
     catch (Exception ex)
     {
         string b = ex.Message;
         Program.logerror(b + "  " + "error_in_getallRainbow_method");
         throw new HttpResponseException(HttpStatusCode.ServiceUnavailable);
     }
 }
コード例 #2
0
 public int get_id(string name)
 {
     try
     {
         Rainbow_manager rainbow = new Rainbow_manager();
         return(rainbow.Get_id_by_username(name));
     }
     catch (Exception ex)
     {
         string b = ex.Message;
         Program.logerror(b + "  " + "error_in_getallRainbow_method");
         throw new HttpResponseException(HttpStatusCode.NotAcceptable);
     }
 }
コード例 #3
0
 public bool rainbow_update([FromBody] rainbow r)
 {
     try
     {
         Rainbow_manager rainbow = new Rainbow_manager();
         return(rainbow.update_rainbow(r.id, r.rainbow_name, r.description));
     }
     catch (Exception ex)
     {
         string c = ex.Message;
         Program.logerror(c + "  " + "error_in_updateRainbow_method");
         throw new HttpResponseException(HttpStatusCode.ServiceUnavailable);
     }
 }
コード例 #4
0
        public int add_rainbow([FromBody] rainbow r)
        {
            try
            {
                Rainbow_manager rainbow = new Rainbow_manager();
                return(rainbow.insert_rainbow(r));
            }
            catch (Exception ex)
            {
                string  m = ex.Message;
                Program p = new Program();

                Program.logerror(m + "  " + "error_in_insertRainbow_method");

                throw new HttpResponseException(HttpStatusCode.InternalServerError);
            }
        }
コード例 #5
0
 public bool delete_rainbow(int id)
 {
     try
     {
         Rainbow_manager rainbow = new Rainbow_manager();
         return(rainbow.delete_rainbow(id));
     }
     catch (Google.GoogleApiException e)
     {
         string a = e.Message;
         Program.logerror(a + "  " + "google api error in_deleteRainbow_method");
         throw new HttpResponseException(HttpStatusCode.BadRequest);
     }
     catch (Exception ex)
     {
         string a = ex.Message;
         Program.logerror(a + "  " + "error_in_deleteRainbow_method");
         throw new HttpResponseException(HttpStatusCode.BadRequest);
     }
 }
コード例 #6
0
        public rainbow getSingleRainbowDetails(int rainbow_id)
        {
            Rainbow_manager rainbowDetails = new Rainbow_manager();

            return(rainbowDetails.GetRainbowDetailsByRainbowId(rainbow_id));
        }