コード例 #1
0
 static public void dgvCollectionMarks(CollectionInfoForm form)
 {
     form.dgvMarks.DataSource = (from mark in Control.currentCollection.Marks select
                                 new { mark.Id, mark.Value }).ToList();
     form.dgvMarks.Columns[0].Visible = false;
     if (form.dgvMarks.Rows.Count != 0)
     {
         form.dgvMarks[1, 0].Selected = true;
     }
     form.dgvMarks.Update();
 }
コード例 #2
0
 static public void dgvCollectionCategories(CollectionInfoForm form)
 {
     form.dgvCategories.DataSource = (from category in Control.currentCollection.Categories select
                                      new { category.Id, category.Name }).ToList();
     form.dgvCategories.Columns[0].Visible = false;
     if (form.dgvCategories.Rows.Count != 0)
     {
         form.dgvCategories[1, 0].Selected = true;
     }
     form.dgvCategories.Update();
 }
コード例 #3
0
 static public void dgvCollectionObjects(CollectionInfoForm form)
 {
     form.dgvObjects.DataSource = (from obj in Control.currentCollection.Objects select
                                   new { obj.Id, obj.Name, obj.Description, obj.CreatingDate, obj.AvarageMark }).ToList();
     form.dgvObjects.Columns[0].Visible = false;
     if (form.dgvObjects.Rows.Count != 0)
     {
         form.dgvObjects[1, 0].Selected = true;
     }
     form.dgvObjects.Update();
 }
コード例 #4
0
 static public void dgvCollectionCreators(CollectionInfoForm form)
 {
     form.dgvCreators.DataSource = (from user in Control.currentCollection.Users select
                                    new { user.Id, user.Name }).ToList();
     form.dgvCreators.Columns[0].Visible = false;
     if (form.dgvCreators.Rows.Count != 0)
     {
         form.dgvCreators[1, 0].Selected = true;
     }
     form.dgvCreators.Update();
 }
コード例 #5
0
 static public void dgvCollectionComments(CollectionInfoForm form)
 {
     form.dgvComments.DataSource = (from comment in Control.currentCollection.Comments select
                                    new { comment.Id, comment.User.Name, comment.Title, comment.Description, comment.Date }).ToList();
     form.dgvComments.Columns[0].Visible = false;
     if (form.dgvComments.Rows.Count != 0)
     {
         form.dgvComments[1, 0].Selected = true;
     }
     form.dgvComments.Update();
 }
コード例 #6
0
 private void btnCollectionInfo_Click(object sender, EventArgs e)
 {
     if (Control.currentUser.Collections.Count != 0)
     {
         try
         {
             int id = Control.FindID(dgvCollections);
             Control.currentCollection = Control.container.Collections.Find(id);
             CollectionInfoForm collectionInfoForm = new CollectionInfoForm();
             collectionInfoForm.ShowDialog();
             Control.ForgetCurrentCollection();
             CompleteForm.dgvCollections(this);
         }
         catch (Exception)
         {
             Control.Exclamation("Выберите коллекцию, чтобы просмотреть ее данные.", "Информация о коллекции");
         }
     }
     else
     {
         Control.Exclamation("Вы еще не создали ни одной коллекции.", "Информация о коллекции");
     }
 }