示例#1
0
 private void TableResultList_CellEnter(object sender, DataGridViewCellEventArgs e)
 {
     if (TableResultList.SelectedRows.Count > 0)
     {
         UserSystems us = model.UserSystems.Find(TableResultList.SelectedRows[0].Cells[0].Value);
         labelUserName.Text        = us.UserData.NameUser;
         labelSystemName.Text      = us.SystemCollection.SystemName;
         labelNumberQuestions.Text = (from p in model.UserQuestions
                                      where p.UserSystemsId == us.Id
                                      select p).Count().ToString();
         labelNumberAnswers.Text = (from p in model.UserQuestions
                                    where p.UserSystemsId == us.Id && p.DemandDescriptionId != null
                                    select p).Distinct().Count().ToString();
         double a1 = (from p in model.UserQuestions
                      where p.UserSystemsId == us.Id &&
                      p.DemandDescriptionId != null
                      select p.DemandDescriptionId).Distinct().Count();
         double b1 = (from a in model.DemandDescriptions
                      where a.TypeDemand.GroupDemand.SystemCollectionId == us.SystemCollectionId
                      select a).Count();
         double i = (double)a1 / b1 * 100;
         labelProgress.Text       = Math.Round(i, 2).ToString() + "%";
         panelInformation.Visible = true;
     }
 }
示例#2
0
 private void TableResultList_CellEnter(object sender, DataGridViewCellEventArgs e)
 {
     if (TableResultList.SelectedRows.Count > 0)
     {
         UserSystems us = model.UserSystems.Find(TableResultList.SelectedRows[0].Cells[0].Value);
         dataGridViewGeneral.DataSource = (from p in model.DemandDescriptions
                                           join q in model.UserQuestions
                                           on p.Id equals q.DemandDescriptionId
                                           where p.TypeDemand.GroupDemand.GroupName == label1.Text + " " + us.SystemCollection.SystemName &&
                                           q.UserSystemsId == us.Id
                                           select new
         {
             аздел_требований = p.TypeDemand.TymeName,
             Требование = p.Description
         }).Distinct().ToList();
         dataGridViewGeneral.Columns[dataGridViewGeneral.ColumnCount - 1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
         dataGridViewGeneral.Update();
         dataGridViewGeneral.ClearSelection();
         dataGridViewFunctional.DataSource = (from p in model.DemandDescriptions
                                              join q in model.UserQuestions
                                              on p.Id equals q.DemandDescriptionId
                                              where p.TypeDemand.GroupDemand.GroupName == label2.Text + " " + us.SystemCollection.SystemName &&
                                              q.UserSystemsId == us.Id
                                              select new
         {
             аздел_требований = p.TypeDemand.TymeName,
             Требование = p.Description
         }).Distinct().ToList();
         dataGridViewFunctional.Columns[dataGridViewFunctional.ColumnCount - 1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
         dataGridViewFunctional.Update();
         dataGridViewFunctional.ClearSelection();
         dataGridViewInterface.DataSource = (from p in model.DemandDescriptions
                                             join q in model.UserQuestions
                                             on p.Id equals q.DemandDescriptionId
                                             where p.TypeDemand.GroupDemand.GroupName == label3.Text + " " + us.SystemCollection.SystemName &&
                                             q.UserSystemsId == us.Id
                                             select new
         {
             аздел_требований = p.TypeDemand.TymeName,
             Требование = p.Description
         }).Distinct().ToList();
         dataGridViewInterface.Columns[dataGridViewInterface.ColumnCount - 1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
         dataGridViewInterface.Update();
         dataGridViewInterface.ClearSelection();
         dataGridViewUnfunctional.DataSource = (from p in model.DemandDescriptions
                                                join q in model.UserQuestions
                                                on p.Id equals q.DemandDescriptionId
                                                where p.TypeDemand.GroupDemand.GroupName == label4.Text + " " + us.SystemCollection.SystemName &&
                                                q.UserSystemsId == us.Id
                                                select new
         {
             аздел_требований = p.TypeDemand.TymeName,
             Требование = p.Description
         }).Distinct().ToList();
         dataGridViewUnfunctional.Columns[dataGridViewUnfunctional.ColumnCount - 1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
         dataGridViewUnfunctional.Update();
         dataGridViewUnfunctional.ClearSelection();
     }
 }
        private void button_Create_Click(object sender, EventArgs e)
        {
            UserSystems user_Systems = new UserSystems();

            user_Systems.UserDataId         = user.Id;
            user_Systems.UserData           = user;
            user_Systems.SystemCollectionId = ((SystemCollection)(comboBoxSystems.SelectedValue)).Id;
            user_Systems.SystemCollection   = model.SystemCollections.Find(((SystemCollection)(comboBoxSystems.SelectedValue)).Id);
            model.UserSystems.Add(user_Systems);
            model.SaveChanges();
            Close();
        }
示例#4
0
 public Form_for_chat(ModelQAContainer _model, UserSystems _system)
 {
     InitializeComponent();
     model                       = _model;
     systemCollection            = _system;
     textBox1.Text               = "Здравствуй" + "\n";
     richTextBox1.SelectionColor = Color.FromArgb(0, 192, 192);
     richTextBox1.AppendText(textBox1.Text);
     textBox1.Text = "Здравствуй" + "\n";
     richTextBox1.SelectionColor = Color.Teal;
     richTextBox1.AppendText(textBox1.Text);
     textBox1.Text = "";
 }
示例#5
0
        // PATCH https://undone-resources.firebaseio.com/UserSystems/<SPECIFIC_NODE>.json?access_token=<ACCESS_TOKEN>
        public async Task <HttpResponseMessage> PatchUserSystems(UserSystems user)
        {
            var client = new HttpClient();

            client.BaseAddress = new Uri(projectUrl);
            client.DefaultRequestHeaders.Accept.Clear();
            client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));

            var jsonString = JsonConvert.SerializeObject(user);
            var uniqueId   = user.UserProfileId;
            var response   = await client.PatchAsync("UserSystems/" + uniqueId + ".json?access_token=" + accessToken, new StringContent(jsonString, Encoding.UTF8, "application/json"));

            return(response);
        }
示例#6
0
        private void comboBoxUserSystems_SelectedIndexChanged(object sender, EventArgs e)
        {
            UserSystems systemCollection = model.UserSystems.Find(comboBoxUserSystems.SelectedValue);

            textBoxDescription.Text = systemCollection.SystemCollection.GeneralDescription;

            if (currentChildForm != null)
            {
                currentChildForm.Close();
            }
            Form_for_chat chat = new Form_for_chat(model, systemCollection);

            currentChildForm = chat;

            chat.TopLevel        = false;
            chat.FormBorderStyle = FormBorderStyle.None;
            chat.Dock            = DockStyle.Fill;
            panelForChat.Controls.Add(chat);
            panelForChat.Tag = chat;
            chat.BringToFront();
            chat.Show();
        }