public JsonResult Send(string name, string mobile, string address, string email, string content) { var feedback = new Feedback2(); feedback.Name = name; feedback.Email = email; feedback.CreatedDate = DateTime.Now; feedback.Phone = mobile; feedback.Content = content; feedback.Address = address; var id = new ContactDao().InsertFeedBack(feedback); if (id > 0) { return(Json(new { status = true })); } else { return(Json(new { status = false })); } }
public ActionResult DeleteConfirmed(int id) { Feedback2 feedback2 = db.Feedback2.Find(id); db.Feedback2.Remove(feedback2); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,Name,Phone,Email,Address,Content,CreatedDate,Status")] Feedback2 feedback2) { if (ModelState.IsValid) { db.Entry(feedback2).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(feedback2)); }
public ActionResult Create([Bind(Include = "ID,Name,Phone,Email,Address,Content,CreatedDate,Status")] Feedback2 feedback2) { if (ModelState.IsValid) { db.Feedback2.Add(feedback2); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(feedback2)); }
// GET: Admin/Feedback2/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Feedback2 feedback2 = db.Feedback2.Find(id); if (feedback2 == null) { return(HttpNotFound()); } return(View(feedback2)); }
public async Task <bool> SaveFeedbackTaskAsync(Feedback2 item) { try { await feedbackTable.InsertAsync(item); return(true); } catch (Exception e) { Debug.WriteLine(@"ERROR {0}", e.Message); return(false); } }
public int InsertFeedBack(Feedback2 fb) { db.Feedback2.Add(fb); db.SaveChanges(); return(fb.ID); }
public ExtendedSessionFeedback() { //if (!Xamarin.Insights.IsInitialized) //{ // Xamarin.Insights.Initialize("cb9dddf47d18b81b88181a4f106fcb7565048148"); // Insights.ForceDataTransmission = true; // if (!string.IsNullOrEmpty(App.uuid)) // { // var manyInfos = new Dictionary<string, string> { // { Xamarin.Insights.Traits.GuestIdentifier, App.uuid }, // { "CurrentCulture", CultureInfo.CurrentCulture.Name } // }; // Xamarin.Insights.Identify(App.uuid, manyInfos); // } //} IDictionary <string, string> info = new Dictionary <string, string>(); if (App.CurrentSession != null) { info = new Dictionary <string, string> { { "SessionId", App.CurrentSession.Id } } } ; handle = Insights.TrackTime("ExtendedFeedbackTime", info); var titleLabel = new FontLabel { Font = Device.OnPlatform(Font.OfSize("HelveticaNeue-Light", NamedSize.Small), Font.SystemFontOfSize(18), Font.SystemFontOfSize(22)), FontLabelType = FontLabelType.Light, LineBreakMode = LineBreakMode.WordWrap, TextColor = App.XamBlue, Text = "Session" }; var title = new FontLabel { Font = Device.OnPlatform(Font.OfSize("HelveticaNeue-Light", NamedSize.Small), Font.SystemFontOfSize(18), Font.SystemFontOfSize(22)), FontLabelType = FontLabelType.Light, LineBreakMode = LineBreakMode.WordWrap, TextColor = Color.White, Text = App.CurrentSession.Title }; var registrationIdLabel = new FontLabel { Font = Device.OnPlatform(Font.OfSize("HelveticaNeue-Light", NamedSize.Small), Font.SystemFontOfSize(18), Font.SystemFontOfSize(22)), FontLabelType = FontLabelType.Light, LineBreakMode = LineBreakMode.WordWrap, TextColor = App.XamBlue, Text = "Registration Id *" }; registrationEntry = new Entry { Placeholder = "XXXXXXXX", TextColor = Device.OnPlatform(Color.Black, Color.White, Color.White), Keyboard = Keyboard.Numeric, }; registrationEntry.Unfocused += async(sender, args) => { if (!String.IsNullOrEmpty(registrationEntry.Text) && !long.TryParse(registrationEntry.Text, out uuid)) { registrationEntry.Text = ""; await DisplayAlert("Invalid Registration Id!", "Please check your Tag for Registration Id.", "OK"); registrationEntry.Focus(); } }; var changeLink = new FontLabel { Font = Device.OnPlatform(Font.OfSize("HelveticaNeue-Light", NamedSize.Micro), Font.SystemFontOfSize(14), Font.SystemFontOfSize(22)), FontAttributes = FontAttributes.Italic, FontLabelType = FontLabelType.Light, LineBreakMode = LineBreakMode.WordWrap, VerticalOptions = LayoutOptions.End, TextColor = App.XamDarkBlue, Text = "Edit" }; var tap = new TapGestureRecognizer((view, obj) => { registrationEntry.IsEnabled = true; registrationEntry.Focus(); changeLink.IsVisible = false; }); changeLink.GestureRecognizers.Add(tap); var registrationStack = new StackLayout { Orientation = StackOrientation.Horizontal, }; if (!String.IsNullOrEmpty(App.uuid)) { registrationEntry.Text = App.uuid; registrationEntry.IsEnabled = false; registrationStack.Children.Add(registrationEntry); registrationStack.Children.Add(changeLink); } else { registrationStack.Children.Add(registrationEntry); registrationEntry.IsEnabled = true; } var questionOne = new FontLabel { Font = Device.OnPlatform(Font.OfSize("HelveticaNeue-Light", NamedSize.Small), Font.SystemFontOfSize(18), Font.SystemFontOfSize(22)), FontLabelType = FontLabelType.Light, LineBreakMode = LineBreakMode.WordWrap, TextColor = App.XamBlue, Text = "Quality of Session Content *" }; var answerOnePicker = new Picker { Title = "Select", }; answerOnePicker.Items.Add("4 - Excellent"); answerOnePicker.Items.Add("3"); answerOnePicker.Items.Add("2"); answerOnePicker.Items.Add("1 - Poor"); var questionTwo = new FontLabel { Font = Device.OnPlatform(Font.OfSize("HelveticaNeue-Light", NamedSize.Small), Font.SystemFontOfSize(18), Font.SystemFontOfSize(22)), FontLabelType = FontLabelType.Light, LineBreakMode = LineBreakMode.WordWrap, TextColor = App.XamBlue, Text = "Quality of Session Delivery *" }; var answerTwoPicker = new Picker { Title = "Select", }; answerTwoPicker.Items.Add("4 - Excellent"); answerTwoPicker.Items.Add("3"); answerTwoPicker.Items.Add("2"); answerTwoPicker.Items.Add("1 - Poor"); var questionThree = new FontLabel { Font = Device.OnPlatform(Font.OfSize("HelveticaNeue-Light", NamedSize.Small), Font.SystemFontOfSize(18), Font.SystemFontOfSize(22)), FontLabelType = FontLabelType.Light, LineBreakMode = LineBreakMode.WordWrap, TextColor = App.XamBlue, Text = "Overall Session Quality *" }; var answerThreePicker = new Picker { Title = "Select", }; answerThreePicker.Items.Add("4 - Excellent"); answerThreePicker.Items.Add("3"); answerThreePicker.Items.Add("2"); answerThreePicker.Items.Add("1 - Poor"); var feedbackLabel = new FontLabel { Font = Device.OnPlatform(Font.OfSize("HelveticaNeue-Light", NamedSize.Small), Font.SystemFontOfSize(18), Font.SystemFontOfSize(22)), FontLabelType = FontLabelType.Light, LineBreakMode = LineBreakMode.WordWrap, TextColor = App.XamBlue, Text = "Feedback" }; var txtFeedback = new Editor { VerticalOptions = LayoutOptions.FillAndExpand, }; var extendedQuestion = new FontLabel { Font = Device.OnPlatform(Font.OfSize("HelveticaNeue-Light", NamedSize.Small), Font.SystemFontOfSize(18), Font.SystemFontOfSize(22)), FontLabelType = FontLabelType.Light, LineBreakMode = LineBreakMode.WordWrap, TextColor = App.XamBlue, Text = "Overall feedback for your experience at Azure Conference till now:" }; var questionFour = new FontLabel { Font = Device.OnPlatform(Font.OfSize("HelveticaNeue-Light", NamedSize.Small), Font.SystemFontOfSize(18), Font.SystemFontOfSize(22)), FontLabelType = FontLabelType.Light, LineBreakMode = LineBreakMode.WordWrap, TextColor = App.XamBlue, Text = "How satisfied were you with this event *" }; var answerFourPicker = new Picker { Title = "Select", }; answerFourPicker.Items.Add("4 - Very Satisfied"); answerFourPicker.Items.Add("3"); answerFourPicker.Items.Add("2"); answerFourPicker.Items.Add("1 - Very Dissatisfied"); var questionFive = new FontLabel { Font = Device.OnPlatform(Font.OfSize("HelveticaNeue-Light", NamedSize.Small), Font.SystemFontOfSize(18), Font.SystemFontOfSize(22)), FontLabelType = FontLabelType.Light, LineBreakMode = LineBreakMode.WordWrap, TextColor = App.XamBlue, Text = "How likely are you to complete a web site, business solution, or consumer app (using any OS) that utilizes Azure services in the next 6 months? *" }; var answerFivePicker = new Picker { Title = "Select", }; answerFivePicker.Items.Add("4 - Very likely"); answerFivePicker.Items.Add("3"); answerFivePicker.Items.Add("2"); answerFivePicker.Items.Add("1 - Not at all"); var questionSix = new FontLabel { Font = Device.OnPlatform(Font.OfSize("HelveticaNeue-Light", NamedSize.Small), Font.SystemFontOfSize(18), Font.SystemFontOfSize(22)), FontLabelType = FontLabelType.Light, LineBreakMode = LineBreakMode.WordWrap, TextColor = App.XamBlue, Text = "How likely are you to recommend the use of Microsoft products/solutions to colleagues or peers? *" }; var answerSixPicker = new Picker { Title = "Select", }; answerSixPicker.Items.Add("4 - Very likely"); answerSixPicker.Items.Add("3"); answerSixPicker.Items.Add("2"); answerSixPicker.Items.Add("1 - Not at all"); var buttonReset = new Button { Text = "Reset" }; var buttonSubmit = new Button { Text = "Submit" }; buttonReset.Clicked += (sender, args) => { answerOnePicker.SelectedIndex = answerTwoPicker.SelectedIndex = answerThreePicker.SelectedIndex = answerFourPicker.SelectedIndex = answerFivePicker.SelectedIndex = answerSixPicker.SelectedIndex = -1; txtFeedback.Text = ""; }; var spinner = new ActivityIndicator { IsRunning = false, IsVisible = false, Color = Device.OnPlatform(App.XamBlue, Color.White, Color.White) }; var isSubmitting = false; buttonSubmit.Clicked += async(sender, args) => { if (!App.NetworkMonitor.IsAvailable()) { await DisplayAlert("No Internet Connectivity!", "Your Phone is not connected to the Internet. Please connect and try again.", "OK"); } else if (isSubmitting == false) { isSubmitting = true; var answerOne = Utils.GetPickerValue(answerOnePicker.SelectedIndex); var answerTwo = Utils.GetPickerValue(answerTwoPicker.SelectedIndex); var answerThree = Utils.GetPickerValue(answerThreePicker.SelectedIndex); var answerFour = Utils.GetPickerValue(answerFourPicker.SelectedIndex); var answerFive = Utils.GetPickerValue(answerFivePicker.SelectedIndex); var answerSix = Utils.GetPickerValue(answerSixPicker.SelectedIndex); if (!String.IsNullOrEmpty(registrationEntry.Text) && !long.TryParse(registrationEntry.Text, out uuid)) { registrationEntry.Text = ""; await DisplayAlert("Invalid Registration Id!", "Please check your Tag for Registration Id.", "OK"); registrationEntry.Focus(); } else if (uuid == 0 || answerOne == -1 || answerTwo == -1 || answerThree == -1) { await DisplayAlert("Mandatory inputs missing!", "Please provide your response for the mandatory(*) fields.", "OK"); isSubmitting = false; } else { try { spinner.IsRunning = true; spinner.IsVisible = true; var feedback = new Feedback2(); feedback.OverallRating = answerThree; feedback.PlatformId = Device.OnPlatform(3, 2, 1); feedback.SessionId = App.CurrentSession.Id; feedback.SessionRating = answerOne; feedback.SpeakerRating = answerTwo; feedback.TextFeedback = txtFeedback.Text; feedback.UserId = uuid; App.uuid = uuid.ToString(); feedback.ToContact = true; var eventFeedback = new Eventfeedback(); eventFeedback.UserId = uuid; eventFeedback.OverallSatisfaction = answerFour; eventFeedback.CompleteAzure = answerFive; eventFeedback.RecommendAzure = answerSix; Insights.Track("ContactUs Data", new Dictionary <string, string> { { "UserID", uuid.ToString() }, { "Feedback", JsonConvert.SerializeObject(feedback) }, { "EventFeedback", JsonConvert.SerializeObject(eventFeedback) } }); await DisplayAlert("Submitting you feedback!", "Please wait while we submit your feedback.", "OK"); var res = await App.feedbackManager.SaveFeedbackTaskAsync(feedback); var res1 = await App.feedbackManager.SaveEventFeedbackTaskAsync(eventFeedback); if (!res || !res1) { await DisplayAlert("No Internet Connectivity!", "Your Phone is not connected to the Internet. Please connect and try again.", "OK"); } else { App.FeedbackList.Add(App.CurrentSession.Id); if (App.CurrentDayType == DayTypes.Day1) { App.DayOneFeedbackCount = App.DayOneFeedbackCount + 1; App.DayOneExtFeedback = true; AppStorageHelper.SaveDayOneExtFeedback(1); AppStorageHelper.SaveDayOneFeedbackCount(App.DayOneFeedbackCount); } else if (App.CurrentDayType == DayTypes.Day2) { App.DayTwoFeedbackCount = App.DayTwoFeedbackCount + 1; App.DayTwoExtFeedback = true; AppStorageHelper.SaveDayTwoExtFeedback(1); AppStorageHelper.SaveDayTwoFeedbackCount(App.DayTwoFeedbackCount); } await DisplayAlert("Thank You!", "Thanks for providing your valuable feedback.", "OK"); handle.Stop(); await this.Navigation.PopAsync(); } } catch (Exception ex) { Insights.Report(ex); } isSubmitting = false; spinner.IsVisible = false; spinner.IsRunning = false; } } }; var stackButtons = new StackLayout { Orientation = StackOrientation.Horizontal, HorizontalOptions = LayoutOptions.CenterAndExpand, Children = { buttonReset, buttonSubmit }, }; var feedbackStack = new StackLayout { Children = { titleLabel, title, registrationIdLabel, registrationStack, questionOne, answerOnePicker, questionTwo, answerTwoPicker, questionThree, answerThreePicker, feedbackLabel, txtFeedback, extendedQuestion, questionFour, answerFourPicker, questionFive, answerFivePicker, questionSix, answerSixPicker, spinner, stackButtons }, }; var scrollView = new ScrollView { VerticalOptions = LayoutOptions.Fill, Orientation = ScrollOrientation.Vertical, Content = feedbackStack, }; Content = scrollView; Title = "Feedback"; Padding = new Thickness(10, 0); BackgroundColor = Color.Black; BindingContext = _viewModel; }
public IActionResult Feedback2(Feedback2 feedback) { try { //id = (int)Decimal.Parse(feedbackid, NumberStyles.Currency, CultureInfo.InvariantCulture); using (yetkilimDBContext db = new yetkilimDBContext()) { var userId = 0; if (base.CurrentUser != null) { userId = base.CurrentUser.UserId; } try { if (feedback.IsUserShare.HasValue && feedback.IsUserShare.Value) { var user = db.Users.AsNoTracking().FirstOrDefault(x => x.Id == userId); feedback.UserFullName = user.Name; feedback.UserMail = user.Email; feedback.UserPhone = user.Phone; } } catch (Exception) { } feedback.CreatedDate = DateTime.Now; feedback.UserId = userId; try { feedback.IpAddress = this.Request.HttpContext.Connection .RemoteIpAddress .ToString(); } catch (Exception ex) { LoggerExtensions.LogError(_logger, ex, "IP Address error", Array.Empty <object>()); } db.Feedback2.Add(feedback); db.SaveChanges(); try { var listMail = new List <string>(); var userPlaces = db.PanelUser.AsNoTracking().Where(x => x.PlaceId == feedback.PlaceId && !x.IsDeleted).ToList(); if (userPlaces != null && userPlaces.Any()) { listMail.AddRange(userPlaces.Where(x => !string.IsNullOrWhiteSpace(x.Email)).Select(x => x.Email)); } var place = db.Places.First(x => x.Id == feedback.PlaceId); var userCompanies = db.PanelUser.AsNoTracking().Where(x => x.CompanyId == place.CompanyId && !x.IsDeleted).ToList(); if (userCompanies != null && userCompanies.Any()) { listMail.AddRange(userCompanies.Where(x => !string.IsNullOrWhiteSpace(x.Email)).Select(x => x.Email)); } _emailSender.Send( listMail.ToArray() , "Müşteriniz işletmeniz için bir değerlendirme yaptı", myTableMaker(new Feedback2[] { feedback }, "2")); } catch (Exception) { } } } catch (Exception ex) { return(Content(ex.ToString())); } return(new EmptyResult()); }