Example #1
0
 public string Post([FromBody] feedbackModel model)
 {
     try
     {
         string country = model.country;
         if (model.country == null)
         {
             country = "Austin";
         }
         var json = Newtonsoft.Json.JsonConvert.SerializeObject(new
         {
             session = model.Session,
             review  = model.feedbackk,
             rating  = model.rating
         });
         var request = WebRequest.CreateHttp("https://annualsumm.firebaseio.com/Feedback/" + country + ".json");
         request.Method      = "POST";
         request.ContentType = "application/json";
         var buffer = Encoding.UTF8.GetBytes(json);
         request.ContentLength = buffer.Length;
         request.GetRequestStream().Write(buffer, 0, buffer.Length);
         var response = request.GetResponse();
         json = (new StreamReader(response.GetResponseStream())).ReadToEnd();
         return("success");
     }
     catch (Exception ex)
     {
         return(ex.StackTrace);
     }
 }
Example #2
0
        public void Post(feedbackModel model)
        {
            string country = "Austin";
            var    json    = Newtonsoft.Json.JsonConvert.SerializeObject(new
            {
                user_name = model.Email,
                review    = model.feedbackk,
            });
            var request = WebRequest.CreateHttp("https://annualsumm.firebaseio.com/Feedback/" + country + ".json");

            request.Method      = "POST";
            request.ContentType = "application/json";
            var buffer = Encoding.UTF8.GetBytes(json);

            request.ContentLength = buffer.Length;
            request.GetRequestStream().Write(buffer, 0, buffer.Length);
            var response = request.GetResponse();

            json = (new StreamReader(response.GetResponseStream())).ReadToEnd();
        }
 public void EditPostforFeedback(feedbackModel FeedbackModel, feedback entity)
 {
     entity.hr_manual                     = FeedbackModel.hr_manual;
     entity.cims_idpassword               = FeedbackModel.cims_idpassword;
     entity.books                         = FeedbackModel.books;
     entity.library_card                  = FeedbackModel.library_card;
     entity.hr_anyother                   = FeedbackModel.hr_anyother;
     entity.identitycard                  = FeedbackModel.identitycard;
     entity.bank_account                  = FeedbackModel.bank_account;
     entity.notepad                       = FeedbackModel.notepad;
     entity.pen                           = FeedbackModel.pen;
     entity.employee_card                 = FeedbackModel.employee_card;
     entity.admin_anyother                = FeedbackModel.admin_anyother;
     entity.computer_system               = FeedbackModel.computer_system;
     entity.headphones                    = FeedbackModel.headphones;
     entity.emailid_password              = FeedbackModel.emailid_password;
     entity.network_ip                    = FeedbackModel.network_ip;
     entity.firewall_id                   = FeedbackModel.firewall_id;
     entity.domain_usernamepassword       = FeedbackModel.domain_usernamepassword;
     entity.messengers_access             = FeedbackModel.messengers_access;
     entity.systemadmin_anyother          = FeedbackModel.systemadmin_anyother;
     entity.hrmanual_and_responsibilities = FeedbackModel.hrmanual_and_responsibilities;
 }