コード例 #1
0
ファイル: Form1.cs プロジェクト: Kushslush/ObjectRedactor
        private void B_info_Click(object sender, EventArgs e)
        {
            ViewList.Visible = false;
            B_del.Visible    = false;
            B_add.Visible    = false;
            Viewinfo.Visible = true;

            //delmessage
            B_Name.Visible    = B_Author.Visible = B_Pages.Visible = true;
            label1.Visible    = label2.Visible = label3.Visible = label4.Visible = true;
            B_Author.ReadOnly = B_Pages.ReadOnly = true;
            B_Binding.Visible = true;

            SetReadonlyControls(B_Binding.Controls);

            B_Author.Clear(); B_Pages.Clear();
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: Kushslush/ObjectRedactor
        private void Viewinfo_Click(object sender, EventArgs e)
        {
            Book tmp = new Book();

            //Book_Base.FirstOrDefault(q => q.ToString == B_Name.Text);

            foreach (Book current in Book_Base)
            {
                if (current.ToString() == B_Name.Text)
                {
                    tmp = current;
                }
            }

            AddMessage.Visible = true;

            if (tmp.ToString() != "default")
            {
                B_Author.Text = tmp.getAuthor();
                B_Pages.Text  = String.Concat(tmp.getNumberPages());

                SetNoReadonlyControls(B_Binding.Controls);
                if (tmp.getBinding())
                {
                    Hard_Buttom.PerformClick();
                }
                else
                {
                    Soft_button.PerformClick();
                }
                SetReadonlyControls(B_Binding.Controls);

                AddMessage.ForeColor = System.Drawing.Color.Green;
                AddMessage.Text      = "Ноутбук найден";
            }
            else
            {
                AddMessage.Visible   = true;
                AddMessage.ForeColor = System.Drawing.Color.Red;
                AddMessage.Text      = "Такого ноутбука нет!";
                B_Author.Clear(); B_Pages.Clear();
            }
        }