static public void dgvMarks(ObjectInfoForm form) { form.dgvMarks.DataSource = (from mark in Control.currentObject.Marks select new { mark.Id, mark.Value, mark.User.Name }).ToList(); form.dgvMarks.Columns[0].Visible = false; if (form.dgvMarks.Rows.Count != 0) { form.dgvMarks[1, 0].Selected = true; } form.dgvMarks.Update(); }
static public void dgvCategories(ObjectInfoForm form) { form.dgvCategories.DataSource = (from category in Control.currentObject.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(); }
static public void dgvCollections(ObjectInfoForm form) { form.dgvCollections.DataSource = (from collection in Control.currentObject.Collections select new { collection.Id, collection.Name, collection.Description, collection.CreatingDate, collection.AverageMark }).ToList(); form.dgvCollections.Columns[0].Visible = false; if (form.dgvCollections.Rows.Count != 0) { form.dgvCollections[1, 0].Selected = true; } form.dgvCollections.Update(); }
static public void dgvAuthors(ObjectInfoForm form) { form.dgvAuthors.DataSource = (from user in Control.currentObject.Users select new { user.Id, user.Name }).ToList(); form.dgvAuthors.Columns[0].Visible = false; if (form.dgvAuthors.Rows.Count != 0) { form.dgvAuthors[1, 0].Selected = true; } form.dgvAuthors.Update(); }
static public void dgvObjectComments(ObjectInfoForm form) { form.dgvComments.DataSource = (from comment in Control.currentObject.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(); }
private void btnObjectInfo_Click(object sender, EventArgs e) { if (Control.currentUser.Objects.Count != 0) { try { int id = Control.FindID(dgvObjects); Control.currentObject = Control.container.Objects.Find(id); ObjectInfoForm objectInfoForm = new ObjectInfoForm(); objectInfoForm.ShowDialog(); Control.ForgetCurrentObject(); CompleteForm.dgvObjects(this); } catch (Exception) { Control.Exclamation("Выберите объект, чтобы просмотреть его данные.", "Информация об объекте"); } } else { Control.Exclamation("Вы еще не создали ни одного объекта.", "Информация об объекте"); } }