Example #1
0
        private void НовыйToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form_Library_Add fm = new Form_Library_Add();

            fm.TextForm = "Добавить ";
            fm.FormType = treeView1.SelectedNode.Text;
            fm.TypeNme  = treeView1.SelectedNode.Name.ToString();
            fm.Type     = "NEW";
            fm.Act      = true;
            fm.Show();
        }
Example #2
0
        private void  едактироватьToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (dataGrid_Library.SelectedRows.Count > 0)
            {
                Form_Library_Add fm = new Form_Library_Add();
                fm.TextForm = "Редактировать ";
                fm.FormType = treeView1.SelectedNode.Text;
                fm.TypeNme  = treeView1.SelectedNode.Name.ToString();
                fm.Type     = "EDIT";
                fm.TID      = Convert.ToDecimal(dataGrid_Library.CurrentRow.Cells["TID"].Value);
                fm.Names    = dataGrid_Library.CurrentRow.Cells["NAME"].Value.ToString();

                string a = dataGrid_Library.CurrentRow.Cells["ACTIVE"].Value.ToString();

                if (a == "Y")
                {
                    fm.Act = true;
                }
                else
                {
                    fm.Act = false;
                }


                if (treeView1.SelectedNode.Name == "lib_en")
                {
                    fm.Key_id = Convert.ToDecimal(dataGrid_Library.CurrentRow.Cells["TID"].Value);
                }
                else if (treeView1.SelectedNode.Name == "dop_uslugi")
                {
                    fm.Uroven2 = dataGrid_Library.CurrentRow.Cells["UROVEN2"].Value.ToString();
                    fm.Uroven3 = dataGrid_Library.CurrentRow.Cells["UROVEN3"].Value.ToString();
                    fm.Key_id  = Convert.ToDecimal(dataGrid_Library.CurrentRow.Cells["KEY_ID"].Value);
                }
                else
                {
                    fm.Uroven2 = dataGrid_Library.CurrentRow.Cells["UROVEN2"].Value.ToString();
                    fm.Key_id  = Convert.ToDecimal(dataGrid_Library.CurrentRow.Cells["KEY_ID"].Value);
                }

                fm.Show();
            }
        }