Inheritance: PagedCollectionOfFeedbackItemte0r55Be
        //
        //On click of Submit: Validates selection, stores feedback and navigates to Logout form
        //
        protected void submit_Click(object sender, EventArgs e)
        {
            if ((comboBox1.SelectedIndex == -1) || (comboBox2.SelectedIndex == -1) || (comboBox3.SelectedIndex == -1) || (comboBox4.SelectedIndex == -1) || (comboBox5.SelectedIndex == -1))
                System.Web.HttpContext.Current.Response.Write("<SCRIPT LANGUAGE='JavaScript'>alert('Some error! Please Check again!')</SCRIPT>");
                //MessageBox.Show("Please select a valid entry.", "Error");
            else
            {
                Feedback g = new Feedback();
                g.employee_ID = emp.employee_Id;
                g.exam_ID = ed.exam_ID;
                g.answer1 = Convert.ToInt32(comboBox1.SelectedItem.ToString());
                g.answer2 = Convert.ToInt32(comboBox2.SelectedItem.ToString());
                g.answer3 = Convert.ToInt32(comboBox3.SelectedItem.ToString());
                g.answer4 = Convert.ToInt32(comboBox4.SelectedItem.ToString());
                g.answer5 = Convert.ToInt32(comboBox5.SelectedItem.ToString());
                string feed = f.addFeedback(g);

                Session["employee"] = emp;
                Session["exam"] = ed;

                //MessageBox.Show(feed, "Feedback");

                /*LogoutForm fm9 = new LogoutForm(emp, ed);
                fm9.MdiParent = this.MdiParent;
                fm9.Dock = DockStyle.Fill;
                this.Close();
                fm9.Show();*/
                Response.Redirect("~/LogoutForm.aspx");
            }
        }
    // palautteen tallennus
    private bool saveFeedback(Feedback newFeedback)
    {

        try
        {
            // lisätään xelement tiedostoon
            this.feedbackFile.Add(
                    new XElement("palaute",
                        new XElement("pvm", newFeedback.Date),
                        new XElement("tekija", newFeedback.Name),
                        new XElement("opintojaksonimi", newFeedback.ClassName),
                        new XElement("opintojaksokoodi", newFeedback.ClassCode),
                        new XElement("opittu", newFeedback.Learned),
                        new XElement("haluanoppia", newFeedback.WantToLearn),
                        new XElement("hyvaa", newFeedback.Good),
                        new XElement("parannettavaa", newFeedback.Bad),
                        new XElement("muuta", newFeedback.Other)
                    )
                );

            // yritetään tallentaa xelement tiedostoa
            this.feedbackFile.Save(HttpContext.Current.Server.MapPath("~/App_Data/Palautteet.xml"));
            
        }
        catch (Exception)
        {
            return false;
        }
        return true;

    }
Example #3
0
 private void Method(int value, Feedback fb)
 {
     if (fb != null)
     {
         fb(value);  //call all methods in delegate variable with value parameter 
     } 
 }
Example #4
0
 private static void Counter(Int32 from, Int32 to, Feedback fb) {
    for (Int32 val = from; val <= to; val++) {
       // If any callbacks are specified, call them
       if (fb != null)
          fb(val);
    }
 }
Example #5
0
        public IHttpActionResult PutFeedback(int id, Feedback feedback)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != feedback.ID)
            {
                return BadRequest();
            }

            db.Entry(feedback).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!FeedbackExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
Example #6
0
 public virtual void Insert( Feedback f, String lnkReplyList )
 {
     Result result = db.insert( f );
     if (result.IsValid) {
         addNotification( f, lnkReplyList );
     }
 }
    private void PopulateClosedFeedback()
    {
        var feedbackTable = (DataView) this.sqlFeedback.Select(DataSourceSelectArguments.Empty);

        if (feedbackTable == null)
        {
            return;
        }

        feedbackTable.RowFilter = "CustomerID =" + this.txtCustomerId.Text + " AND DateClosed IS NOT NULL";

        if (feedbackTable.Count <= 0)
        {
            this.DisableControls();
            return;
        }

        foreach (DataRowView row in feedbackTable)
        {
            var customerFeedback = new Feedback
            {
                FeedbackId = row["FeedbackID"].ToString(),
                SoftwareId = row["SoftwareID"].ToString(),
                DateClosed = row["DateClosed"].ToString(),
                Title = row["Title"].ToString()
            };
            this.lbClosedFeedback.Items.Add(new ListItem(customerFeedback.FormatFeedback(), customerFeedback.FeedbackId));
        }

        this.EnableControls();
        SetFocus(this.lbClosedFeedback);
    }
    public void WriteXMLFile(Feedback palis)
    {
        /*
        using (XmlWriter writer = XmlWriter.Create(@"D:\H3340\1.xml"))
        {
            writer.WriteStartDocument();
            writer.WriteStartElement("Palaute");
            writer.WriteElementString("pvm", palis.Date);
            writer.WriteElementString("tekija", palis.Name);
            writer.WriteElementString("opittu", palis.Learned);
            writer.WriteElementString("haluanoppia", palis.WantToLearn);
            writer.WriteElementString("hyvaa", palis.Good);
            writer.WriteElementString("parannettavaa", palis.Improvements);
            writer.WriteElementString("muuta", palis.Others);
            writer.WriteEndElement();
            writer.WriteEndDocument();
        }
        */

        XDocument doc = XDocument.Load(@"D:\H3340\1.xml"); //Tähän T8Palaute.Properties.Settings.Default.yhteys (app.configista) niin menee sit ghostille
        XElement palautteet = doc.Element("palautteet");
        palautteet.Add(new XElement("palaute",
                   new XElement("pvm", palis.Date),
                   new XElement("tekija", palis.Name),
                   new XElement("opittu", palis.Learned),
                   new XElement("haluanoppia", palis.WantToLearn),
                   new XElement("hyvaa", palis.Good),
                   new XElement("parannettavaa", palis.Improvements),
                   new XElement("muuta", palis.Others)));
        doc.Save(@"D:\H3340\1.xml");
    }
Example #9
0
 public virtual void Insert( Feedback f )
 {
     Result result = db.insert( f );
     if (result.IsValid) {
         addFeedInfo( f );
         addNotification( f );
     }
 }
Example #10
0
 private static void Counter(Int32 from, Int32 to, Feedback fb)
 {
     for (Int32 val = from; val <= to; val++)
     {
         if (fb != null) {
             fb(val);
         }
     }
 }
Example #11
0
 public async Task<Feedback> AddFeedbackAsync(Feedback feedback)
 {
     var emailTask = MessagingPlugin.EmailMessenger;
     if(emailTask.CanSendEmail)
     {
         emailTask.SendEmail("*****@*****.**", "My Shop Feedback", feedback.ToString());
     }
     return feedback;
 }
 public void Can_insert_post_comment()
 {
     var postComment = new Feedback();
     postService.Expect(x => x.GetPostById(blog, 1))
         .Return(new Post {FriendlyTitle = "m"});
     var actionResult = controller.AddComment(1, postComment);
     Assert.That(((ViewResult) actionResult).ViewName == "Read");
     Assert.That(actionResult, Is.Not.Null);
     postService.AssertWasCalled(x => x.AddComment(postComment));
 }
Example #13
0
		public void AddComment(Feedback comment)
		{
			var commentAdding = new CommentAddingEventArgs(this, comment);
			CommentAdding.Raise(commentAdding);
			if (commentAdding.Cancel)
				return;
			postRepository.SaveComment(comment);
			var commentAdded = new CommentAddedEventArgs(this, comment);
			CommentAdded.Raise(commentAdded);
		}
Example #14
0
        private void addNotification( Feedback f, String lnkReplyList )
        {
            int receiverId = f.Target.Id;
            if (f.Creator.Id == receiverId) return;

            String feedbackInfo = lang.get( "feedbackInfo" );
            String spaceLink = "<a href=\"" + lnkReplyList + "\">" + lang.get( "yourSpace" ) + "</a>";
            String msg = string.Format( feedbackInfo, f.Creator.Name, spaceLink );

            nfService.send( receiverId, typeof( User ).FullName, msg, NotificationType.Comment );
        }
Example #15
0
        internal delegate void Feedback(int value); //delegate(it's just type) for method with int param and void return value

        public void Test()
        {
            Feedback fb1 = new Feedback(Method1); //set method to delegate variable
            Feedback fb2 = new Feedback(Method2);

            Feedback fb = null; //combine all methods in 1 delegate variable
            fb += fb1;
            fb += fb2;

            Method(11, fb); 
        }
        public FeedbackDataModel(Feedback feedback)
        {
            this.Id = feedback.Id;
            this.Type = feedback.Type;
            this.PostDate = feedback.PostDate;
            this.Text = feedback.Text;
            this.UserId = feedback.UserId;
            this.Comments = feedback.Comments.AsQueryable().Select(c => new CommentDataModel(c));
            this.AddressedTo = feedback.AddressedTo;
//            this.UserName = feedback.User.UserName;
        }
Example #17
0
        public IHttpActionResult PostFeedback(Feedback feedback)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            db.Feedbacks.Add(feedback);
            db.SaveChanges();

            return CreatedAtRoute("DefaultApi", new { id = feedback.ID }, feedback);
        }
        public ActionResult Create(Feedback feedback, string feedbackTypeDropdown)
        {
            _PopulateDropdown(string.Empty);

            if (string.IsNullOrEmpty(feedback.Description))
                return View();

            feedback.Type = Extension.GetValueFromDescription<EFeedbackType>(feedbackTypeDropdown);
            feedback.Date = DateTime.Now;
            this._FeedbackService.CreateFeedback(feedback);

            return RedirectToAction("Index");
        }
        public IServiceResults<Guid> Add(Feedback model)
        {
            model.SendFeedbackDate = DateTime.Now;
            model.FeedbackId = Guid.NewGuid();
            _feedback.Add(model);
            var saveResult = _uow.SaveChanges();

            return new ServiceResults<Guid>
            {
                IsSuccessfull = saveResult.ToBool(),
                Message = saveResult.ToMessage(BusinessMessage.Error),
                Result = model.FeedbackId
            };
        }
 public void like_touched(object sender, TouchEventArgs te)
 {
     this.num_likes.Content = (Convert.ToInt32(this.num_likes.Content) + 1).ToString();
     Feedback f = new Feedback();
     f.note = "true"; f.date = DateTime.Now; f.type_id = 2; f.user_id = 0; f.parent_id = 0;
     f.object_type = "nature_net.Contribution"; f.object_id = Convert.ToInt32(this.Tag);
     database_manager.InsertFeedback(f);
     window_manager.load_design_ideas_sync();
     te.Handled = true;
     if (sender == null)
         log.WriteInteractionLog(12, "item: " + this.ToString(), te.TouchDevice);
     else
         log.WriteInteractionLog(13, "item: " + this.ToString(), te.TouchDevice);
 }
Example #21
0
 public static void ToFeedback(this FeedbackDto hrInterviewDto, Feedback feedback)
 {
     feedback.CardId = hrInterviewDto.CardId;
     feedback.Type = hrInterviewDto.Type;
     feedback.Text = hrInterviewDto.Text;
     feedback.SuccessStatus = (SuccessStatus) hrInterviewDto.SuccessStatus;
     if (hrInterviewDto.Id != 0)
     {
         feedback.Edited = DateTime.Now;
     }
     else
     {
         feedback.Added = DateTime.Now;
     }
 }
        /// <summary>
        /// Function to save feedback details.
        /// </summary>
        /// <param name="feedback">feedback information</param>
        public void InsertOrUpdate(Feedback feedback)
        {
            if (feedback == null)
            {
                throw new ArgumentNullException(FeedbackConst);
            }

            if (feedback.ApplicationID == default(byte))
            {
                feedback.ApplicationID = (byte?)ApplicationType.Website;
            }

            this.feedbackRepository.InsertOrUpdate(feedback);
            this.unitOfWork.Save();
        }
		public CodeGeneratorResult Check (bool condition, Feedback ok, Feedback failed, 
		                                  object title = null, object text = null) {
			if (condition) {
				feedback = ok;
			} else {
				feedback = failed;
				if (title != null) {
					ErrorTitle = title.ToString ();
				}
				if (text != null) {
					ErrorText = text.ToString ();
				}
			}
			return this;
		}
Example #24
0
   private static void ChainDelegateDemo1(DelegateIntro di) {
      Console.WriteLine("----- Chain Delegate Demo 1 -----");
      Feedback fb1 = new Feedback(FeedbackToConsole);
      Feedback fb2 = new Feedback(FeedbackToMsgBox);
      Feedback fb3 = new Feedback(di.FeedbackToFile);

      Feedback fbChain = null;
      fbChain = (Feedback)Delegate.Combine(fbChain, fb1);
      fbChain = (Feedback)Delegate.Combine(fbChain, fb2);
      fbChain = (Feedback)Delegate.Combine(fbChain, fb3);
      Counter(1, 2, fbChain);

      Console.WriteLine();
      fbChain = (Feedback)Delegate.Remove(fbChain, new Feedback(FeedbackToMsgBox));
      Counter(1, 2, fbChain);
   }
Example #25
0
   private static void ChainDelegateDemo2(DelegateIntro di) {
      Console.WriteLine("----- Chain Delegate Demo 2 -----");
      Feedback fb1 = new Feedback(FeedbackToConsole);
      Feedback fb2 = new Feedback(FeedbackToMsgBox);
      Feedback fb3 = new Feedback(di.FeedbackToFile);

      Feedback fbChain = null;
      fbChain += fb1;
      fbChain += fb2;
      fbChain += fb3;
      Counter(1, 2, fbChain);

      Console.WriteLine();
      fbChain -= new Feedback(FeedbackToMsgBox);
      Counter(1, 2, fbChain);
   }
        /// <summary>
        /// Function to save feedback details.
        /// </summary>
        /// <param name="feedback">feedback information.</param>
        public void InsertOrUpdate(Feedback feedback)
        {
            if (feedback == null)
            {
                throw new ArgumentNullException(FeedbackConstant);
            }

            if (feedback.FeedbackID == default(int))
            {
                this.unitOfWork.Context.Entry(feedback).State = EntityState.Added;
            }
            else
            {
                this.unitOfWork.Context.Entry(feedback).State = EntityState.Modified;
            }
        }
	void OnTriggerEnter(Collider col) {
		if(col.gameObject.tag == "Converser")
		{
			// Trigger if the collider is not orbiting.
			OrbReaction reaction = col.gameObject.GetComponent<OrbReaction>();
			if (reaction != null && reaction.StartTrip())
			{
				feedback = col.gameObject.GetComponent<Feedback>();
				feedback.AlternateTrail();
				largeExplosion = (GameObject)Instantiate(largeExplosionPrefab);
				largeExplosion.transform.position = col.transform.position;

				Destroy(gameObject);
			}
		}
	}
    public void Refresh_panel()
    {
        translations = GlobalVariables.translations;
        heading_title.GetComponent<Text> ().text= translations.getString ("activity");
        _subtitle.GetComponent<Text> ().text= translations.getString ("feedback");

        _tab_trialdata.GetComponent<Button> ().GetComponentsInChildren<Text> () [0].text = translations.getString ("trial_data");
        _tab_feedback.GetComponent<Button> ().GetComponentsInChildren<Text> () [0].text = translations.getString ("feedback");
        _label_datetime.GetComponent<Text> ().text= translations.getString ("date");
        _label_feedback.GetComponent<Text> ().text= translations.getString ("feedback");

        //Data of the player
        int user_id = GlobalVariables.user_id;
        int player_id = GlobalVariables.selected_player_id;
        int activity_id = GlobalVariables.selected_activity_id;
        int feedback_id = GlobalVariables.selected_feedback_id;

        Feedback feedback;
        if (feedback_id != 0)
        {
            feedback = _database.getFeedback (feedback_id);

        }
        else
        {
            int coach_id = GlobalVariables.coach.id;
            feedback = new Feedback(0,coach_id,activity_id,"",DateTime.Today.ToString("yyyy/MM/dd H:mm:ss"),0,0,1);
        }

        _input_feedback.GetComponent<InputField> ().text = feedback.text;
        _datetime.GetComponent<Text> ().text = feedback.datetime;

        _button_save.GetComponent<Button>().onClick.AddListener(() => {
            feedback.text = _input_feedback.GetComponent<InputField> ().text;
            _database.saveFeedback(GlobalVariables.user_database,feedback);
        });
        _button_delete.GetComponent<Button>().onClick.AddListener(() => {
            feedback.text = _input_feedback.GetComponent<InputField> ().text;
            feedback.active = 1;
            _database.saveFeedback(GlobalVariables.user_database,feedback);
        });
        _button_cancel.GetComponent<Button>().onClick.AddListener(() => {
            _input_feedback.GetComponent<InputField> ().text = "";
        });
    }
        public ActionResult SubmitFeedback(string comments)
        {
            if (!string.IsNullOrEmpty(comments))
            {
                comments = comments.Replace("\n", "<br/>");
           
                Feedback feedback = new Feedback
                {
                    AddedByDeveloperID = SessionData.Instance.UserInfo.Developer.DeveloperID,
                    AddedDate = DateTime.Now,
                    Description = comments
                };

                this.feedbackService.InsertOrUpdate(feedback);
            }

            return this.Json(true);
        }
        public ActionResult Index(string subject, string message)
        {
            if (subject == "" || message == "")
            {
                ViewBag.Header = "Input incorrect";
                ViewBag.Message = "Either the subject or message of your feedback is not filled.";
                return View("Message", "_Layout");
            }

            Feedback feedback = new Feedback();
            feedback.Subject = subject;
            feedback.Message = message;
            feedback.TeacherID = Application.TeacherID;
            Application.Db.AddToFeedbacks(feedback);
            Application.Db.SaveChanges();
            ViewBag.Header = "Thank you!";
            ViewBag.Message = "Your concern has been sent to the administrators.";
            return View("Message", "_Layout");
        }
Example #31
0
        public bool AddFeedback(Feedback feedback)
        {
            var result = _userRepository.AddFeedback(feedback);

            return(true);
        }
 public void AddFeedback(Feedback feedback)
 {
     _dbcontext.Feedbacks.Add(feedback);
     _dbcontext.SaveChanges();
 }
Example #33
0
 public void Update(Feedback feedback)
 {
     uow.Feedbacks.Update(feedback);
     uow.Save();
 }
Example #34
0
 public override float Predict(Feedback feedback)
 {
     return(Predict(FeatureBuilder.GetLibFmFeatureVector(feedback)));
 }
Example #35
0
 public void Add(Feedback feedback)
 {
     uow.Feedbacks.Create(feedback);
     uow.Save();
 }
 public Feedback Adicionar(Feedback feedback)
 {
     feedback.Id = listaFeedback.Count + 1;
     listaFeedback.Add(feedback);
     return(feedback);
 }
        public void Remover(Feedback feedback)
        {
            int posicao = listaFeedback.FindIndex(e => e.Id == feedback.Id);

            listaFeedback.RemoveAt(posicao);
        }
Example #38
0
 public override EntityFramework.Feedback ConvertToCore(Feedback targetEntity)
 {
     throw new NotImplementedException();
 }
Example #39
0
 public void AddFeedback(Feedback f)
 {
     db.Feedback.Add(f);
     db.SaveChanges();
 }
Example #40
0
 public void CreateFeedback(Feedback Feedback)
 {
     feedbackRepository.Add(Feedback);
 }
Example #41
0
        public List <FeedbackValue> GetFeedbackValueByFeedbackId(long id)
        {
            Feedback feedback = feedbackRepository.GetById(id, "FeedbackValues");

            return(feedback.FeedbackValues.OrderBy(c => c.Position).ToList());
        }
Example #42
0
 public int InsertFeedback(Feedback feed)
 {
     Dbo.Db.Feedback.Add(feed);
     Dbo.Db.SaveChanges();
     return(feed.ID);
 }
Example #43
0
        public async Task ReportAsync()
        {
            try
            {
                Feedback.WriteLine("Before you go - do you want to see the data we collected about you today? :)");

                var knownDataHelper = new KnownDataHelper();

                KnownDataXConnect knownData = await knownDataHelper.GetKnownDataByIdentifierViaXConnect(Identifier);

                if (knownDataHelper != null)
                {
                    if (knownData.ContactId != null)
                    {
                        Feedback.WriteLine(string.Format("Contact id: " + knownData.ContactId));
                    }

                    if (knownData?.PersonalInformationDetails != null && knownData.VisitorInfoMovie != null)
                    {
                        Feedback.WriteLine(string.Format("Your name is {0} {1} and your favorite movie is {2}",
                                                         knownData.PersonalInformationDetails.FirstName,
                                                         knownData.PersonalInformationDetails.LastName,
                                                         knownData.VisitorInfoMovie.FavoriteMovie));
                    }
                    else
                    {
                        Feedback.WriteLine("details or movie was null");
                    }

                    if (knownData?.KnownInteractions != null)
                    {
                        Feedback.WriteLine("Today you have had " + knownData.KnownInteractions.Count + " interactions with us");

                        var i = 0;

                        foreach (var interactionsToday in knownData.KnownInteractions)
                        {
                            i++;
                            var cinemaId = interactionsToday.RawInteraction.GetFacet <CinemaInfo>(CinemaInfo.DefaultFacetKey);
                            Feedback.WriteLine("");

                            Feedback.WriteLine("Interaction #" + i + (cinemaId != null ? " at Cinema #" + cinemaId.CinimaId : string.Empty));

                            Feedback.WriteLine("Events: ");

                            foreach (var evv in interactionsToday.Events)
                            {
                                Feedback.WriteLine(evv.GetType().ToString() + "");
                            }
                            ;
                            Feedback.WriteLine("");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Feedback.WriteLine(ex.Message);
                throw;
            }
            Feedback.ReadKey();
        }
 public bool AddComment(Feedback Feedback)
 {
     return(true);
 }
        private void InitializeViews(int?feedback_id, string action, int?type)
        {
            Feedback feedback;
            Dictionary <int, object> featuresByType = new Dictionary <int, object>();
            Dictionary <int, string> features;
            SelectList options;
            SelectList typesList;

            if (feedback_id.HasValue)
            {
                feedback = feedbackService.GetById(feedback_id.Value);
                Dictionary <int, int> scoreByFeature = GenerateScoreByFeature(feedback);
                features          = new FeaturesServices().GetFeauresForDropDownList(feedback.FeedbackType_Id);
                options           = new SelectList(new ScoresServices().GetOptionsForDropDownList(), "Key", "Value");
                feedbackViewModel = new FeedbackViewModel(feedback, features, options, feedback.Scores.Count, scoreByFeature);
            }
            else
            {
                switch (action)
                {
                case "Send":
                    bool show = false;
                    if (type.HasValue)
                    {
                        if (type == 0)
                        {
                            show = true;
                        }
                    }
                    feedback = new Feedback();
                    if (type.HasValue)
                    {
                        features = new FeaturesServices().GetFeauresForDropDownList(type.Value);
                    }
                    else
                    {
                        features = new Dictionary <int, string>();
                    }
                    options           = new SelectList(new ScoresServices().GetOptionsForDropDownList(), "Key", "Value");
                    feedbackViewModel = new FeedbackViewModel(feedback, features, options, show);
                    break;

                case "Index":
                    if (type.HasValue)
                    {
                        typesList = new SelectList(new FeedbackTypesServices().GetFeedbackTypesForDropDownList(), "Key", "Value", type);
                    }
                    else
                    {
                        typesList = new SelectList(new FeedbackTypesServices().GetFeedbackTypesForDropDownList(), "Key", "Value");
                    }
                    feedbackViewModel = new FeedbackViewModel(typesList);
                    break;

                case "Show":
                    string typeName;
                    Dictionary <int, List <int> > scoreAverageByFeature;
                    options = new SelectList(new ScoresServices().GetAllOptionsForDropDownList(), "Key", "Value");
                    List <string> addCommentsStrings;
                    List <string> commentsStrings;
                    if (type.HasValue)
                    {
                        typeName              = new FeedbackTypesServices().GetById(type.Value).Name;
                        addCommentsStrings    = feedbackService.GetStringsByType("AddComments", type.Value);
                        commentsStrings       = feedbackService.GetStringsByType("Comments", type.Value);
                        scoreAverageByFeature = GenerateScoreAverageByFeature(type.Value);
                        features              = new FeaturesServices().GetFeauresForDropDownList(type.Value);
                        typesList             = new SelectList(new FeedbackTypesServices().GetFeedbackTypesForDropDownList(), "Key", "Value", type.Value);
                    }
                    else
                    {
                        typeName              = "";
                        addCommentsStrings    = new List <string>();
                        commentsStrings       = new List <string>();
                        scoreAverageByFeature = new Dictionary <int, List <int> >();
                        features              = new Dictionary <int, string>();
                        typesList             = new SelectList(new FeedbackTypesServices().GetFeedbackTypesForDropDownList(), "Key", "Value");
                    }
                    feedbackViewModel = new FeedbackViewModel(features, options, scoreAverageByFeature, addCommentsStrings, commentsStrings, typesList, typeName);
                    break;
                }
            }
        }
Example #46
0
        /// <summary>
        /// Please check the condition.
        /// </summary>
        /// <param name="feedback"></param>
        /// <param name="statusType"></param>
        public static void SetStatus(this Feedback feedback, FeedbackStatusTypes statusType)
        {
            switch (statusType)
            {
            case FeedbackStatusTypes.IsViewed:
                feedback.IsViewed = true;
                feedback.IsSolved = false;
                feedback.HasMarkedToFollowUpDate = false;
                feedback.IsInProcess             = false;
                feedback.IsUnSolved = false;
                break;

            case FeedbackStatusTypes.IsInProcess:
                feedback.IsViewed = true;
                feedback.IsSolved = false;
                feedback.HasMarkedToFollowUpDate = false;
                feedback.IsInProcess             = true;
                feedback.IsUnSolved = false;
                break;

            case FeedbackStatusTypes.HasFollowupDate:
                feedback.IsViewed = true;
                feedback.IsSolved = false;
                feedback.HasMarkedToFollowUpDate = true;
                feedback.IsInProcess             = true;
                feedback.IsUnSolved = false;
                break;

            case FeedbackStatusTypes.IsSolved:
                feedback.IsViewed = true;
                feedback.IsSolved = true;
                feedback.HasMarkedToFollowUpDate = false;
                feedback.IsInProcess             = false;
                feedback.IsUnSolved = false;
                break;

            case FeedbackStatusTypes.IsUnsolved:
                feedback.IsViewed = true;
                feedback.IsSolved = false;
                feedback.HasMarkedToFollowUpDate = false;
                feedback.IsInProcess             = false;
                feedback.IsUnSolved = true;
                break;

            case FeedbackStatusTypes.IsNonViewed:
                feedback.IsViewed = false;
                feedback.IsSolved = false;
                feedback.HasMarkedToFollowUpDate = false;
                feedback.IsInProcess             = false;
                feedback.IsUnSolved = false;
                break;

            default:
                feedback.IsViewed = true;
                feedback.IsSolved = false;
                feedback.HasMarkedToFollowUpDate = false;
                feedback.IsInProcess             = false;
                feedback.IsUnSolved = false;
                break;
            }
        }
        public void Editar(Feedback feedback)
        {
            int posicao = listaFeedback.FindIndex(e => e.Id == feedback.Id);

            listaFeedback[posicao] = feedback;
        }
Example #48
0
 public void Create(Feedback feedback)
 {
     _feedbackRepository.Add(feedback);
 }
 public IActionResult Index(Feedback feedback)
 {
     _feedbackRepository.AddFeedBack(feedback);
     return(View());
 }
Example #50
0
 public void Add(Feedback feedback)
 {
     Feedback.Add(feedback);
 }
Example #51
0
 public EntityBase ManagementLeaveFeedback(Feedback feedback)
 {
     throw new NotImplementedException();
 }
Example #52
0
 public int InsertFeedBack(Feedback fb)
 {
     db.Feedbacks.Add(fb);
     db.SaveChanges();
     return(fb.ID);
 }
Example #53
0
        public Feedback GetById(int id)
        {
            Feedback feedback = uow.Feedbacks.GetById(id);

            return(feedback);
        }
Example #54
0
    /// <summary>
    /// Checks if move valid for the appropriate piece
    /// </summary>
    /// <returns>Validity</returns>
    public bool IsPieceSpecificMoveValid()
    {
        bool response;

        switch (PieceTypeID)
        {
        case 1:
            response = pawn.IsValidPawnMove();
            if (response == false)
            {
                Feedback.SetText(errorMessage + transform.tag);
            }

            return(response);

        case 7:
            response = pawn.IsValidPawnMove(true);
            if (response == false)
            {
                Feedback.SetText(errorMessage + transform.tag);
            }

            return(response);

        case 2:
        case 8:
            response = rook.IsValidRookMove();
            if (response == false)
            {
                Feedback.SetText(errorMessage + transform.tag);
            }

            return(response);

        case 3:
        case 9:
            response = bishop.IsValidBishopMove();
            if (response == false)
            {
                Feedback.SetText(errorMessage + transform.tag);
            }

            return(response);

        case 4:
        case 10:
            response = horse.IsValidHorseMove();
            if (response == false)
            {
                Feedback.SetText(errorMessage + transform.tag);
            }

            return(response);

        case 5:
        case 11:
            response = queen.IsValidQueenMove();
            if (response == false)
            {
                Feedback.SetText(errorMessage + transform.tag);
            }

            return(response);

        case 6:
        case 12:
            return(king.IsValidKingMove());

        default:
            Feedback.SetText("this line shouldn't be reachable");
            return(false);
        }
    }
Example #55
0
 public void Create(Feedback feedback)
 {
     _feedback.Add(feedback);
     _feedback.SaveChanges();
 }
Example #56
0
    public List <Move> GetValidMoves()
    {
        List <Move> validMoves = new List <Move>();
        List <Move> moves      = new List <Move>();

        //Debug.LogWarning(name);

        switch (PieceTypeID)
        {
        case 1:
            foreach (Vector2Int delta in PawnDeltas_W)
            {
                moves.Add(new Move(name, tag, delta, piece.CurrentChessCoord + delta));
            }
            break;

        case 7:
            foreach (Vector2Int delta in PawnDeltas_B)
            {
                moves.Add(new Move(name, tag, delta, piece.CurrentChessCoord + delta));
            }
            break;

        case 2:
        case 8:
            foreach (Vector2Int delta in RookDeltas)
            {
                moves.Add(new Move(name, tag, delta, piece.CurrentChessCoord + delta));
            }
            break;

        case 3:
        case 9:
            foreach (Vector2Int delta in BishopDeltas)
            {
                moves.Add(new Move(name, tag, delta, piece.CurrentChessCoord + delta));
            }
            break;

        case 4:
        case 10:
            foreach (Vector2Int delta in HorseDeltas)
            {
                moves.Add(new Move(name, tag, delta, piece.CurrentChessCoord + delta));
            }
            break;

        case 5:
        case 11:
            foreach (Vector2Int delta in RookDeltas)
            {
                moves.Add(new Move(name, tag, delta, piece.CurrentChessCoord + delta));
            }
            foreach (Vector2Int delta in BishopDeltas)
            {
                moves.Add(new Move(name, tag, delta, piece.CurrentChessCoord + delta));
            }
            break;

        case 6:
        case 12:
            foreach (Vector2Int delta in KingDeltas)
            {
                moves.Add(new Move(name, tag, delta, piece.CurrentChessCoord + delta));
            }
            break;
        }

        string temp = Feedback.GetText();

        foreach (Move move in moves)
        {
            try
            {
                //Debug.Log(move.name);
                if (piece.IsValidMove(move))
                {
                    //Debug.Log(move.name + " accepted");
                    validMoves.Add(move);
                }
                else
                {
                    //Debug.Log(move.name + " rejected");
                }
                Coord_Manager.RevertMove(ref piece.moveDelta);
            } catch
            {
                Coord_Manager.RevertMove(ref piece.moveDelta);
            }
        }

        Feedback.SetText(temp);

        return(validMoves);
    }
 public void DeleteFeedback(Feedback feedback)
 {
     List.Remove(feedback);
 }
Example #58
0
        private async void ExportLogButton_Click(object sender, RoutedEventArgs e)
        {
            StringBuilder result = new StringBuilder();

            var controller =
                await
                UIHelper.GetParentWindow(this)
                .ShowProgressAsync(LocalizationProvider.Instance.GetTextValue("Options.Waiting"),
                                   LocalizationProvider.Instance.GetTextValue("Options.Exporting"));

            controller.SetIndeterminate();

            await System.Threading.Tasks.Task.Run(() =>
            {
                Feedback.OutputLog(ref result);
            });

            await controller.CloseAsync();

            LogWindow logWin = new LogWindow(result.ToString());

            logWin.Show();

            var dialogResult =
                await UIHelper.GetParentWindow(this)
                .ShowMessageAsync(LocalizationProvider.Instance.GetTextValue("Options.SendLogTitle"),
                                  LocalizationProvider.Instance.GetTextValue("Options.SendLog"),
                                  MessageDialogStyle.AffirmativeAndNegative, new MetroDialogSettings()
            {
                AffirmativeButtonText = LocalizationProvider.Instance.GetTextValue("Options.SendButton"),
                NegativeButtonText    = LocalizationProvider.Instance.GetTextValue("Options.DontSendButton")
            });

            string message = null;

            while (dialogResult == MessageDialogResult.Affirmative)
            {
                var sendReportTask = System.Threading.Tasks.Task.Run(() => Feedback.Send(result.ToString()));
                if (message == null)
                {
                    message =
                        UIHelper.GetParentWindow(this)
                        .ShowModalInputExternal(LocalizationProvider.Instance.GetTextValue("Options.Feedback"),
                                                LocalizationProvider.Instance.GetTextValue("Options.FeedbackTip")) ?? string.Empty;
                }

                controller = await UIHelper.GetParentWindow(this)
                             .ShowProgressAsync(LocalizationProvider.Instance.GetTextValue("Options.Waiting"),
                                                LocalizationProvider.Instance.GetTextValue("Options.Sending"));

                controller.SetIndeterminate();

                string exceptionMessage = await sendReportTask;
                if (!string.IsNullOrEmpty(message))
                {
                    var msg = message;
                    await System.Threading.Tasks.Task.Run(() => Feedback.Send(msg, true));
                }

                await controller.CloseAsync();

                if (exceptionMessage == null)
                {
                    UIHelper.GetParentWindow(this)
                    .ShowModalMessageExternal(LocalizationProvider.Instance.GetTextValue("Options.SendSuccessTitle"),
                                              LocalizationProvider.Instance.GetTextValue("Options.SendSuccess"));
                    break;
                }
                else
                {
                    dialogResult =
                        UIHelper.GetParentWindow(this)
                        .ShowModalMessageExternal(LocalizationProvider.Instance.GetTextValue("Options.SendFailed"),
                                                  LocalizationProvider.Instance.GetTextValue("Options.SendFailed") + ":\r\n" +
                                                  exceptionMessage +
                                                  ":\r\n" + LocalizationProvider.Instance.GetTextValue("Options.Mail"),
                                                  MessageDialogStyle.AffirmativeAndNegative, new MetroDialogSettings()
                    {
                        AffirmativeButtonText = LocalizationProvider.Instance.GetTextValue("Options.Retry"),
                    });
                }
            }
        }
Example #59
0
 public void UpdateFeedback(Feedback Feedback)
 {
     feedbackRepository.Update(Feedback);
 }
Example #60
0
        public Feedback CreateFeedback(string title, string description, int rating)
        {
            Feedback feedback = new Feedback(title, description, rating);

            return(feedback);
        }