コード例 #1
0
 public TabHostels()
 {
     InitializeComponent();
     UpdateData(TableName);
     PresentationLayerClass.OnlyReadSwitch(panel1, 0, true);
     PresentationLayerClass.EnableDisableButtons(new Button[] {
         ButtonClear, ButtonSave
     }, false);
 }
コード例 #2
0
 public TabGropes()
 {
     InitializeComponent();
     UpdateData(TableName);
     PresentationLayerClass.NonSortableGrid(dataGridView1);
     PresentationLayerClass.OnlyReadSwitch(panel1, 0, true);
     PresentationLayerClass.EnableDisableButtons(new Button[] {
         ButtonClear, ButtonSave
     }, false);
 }
コード例 #3
0
 public TabStudents()
 {
     InitializeComponent();
     BusinessClass.CreateIfEx();
     UpdateData(TableName);
     PresentationLayerClass.NonSortableGrid(dataGridView1);
     PresentationLayerClass.OnlyReadSwitch(panel1, 3, true);
     PresentationLayerClass.EnableDisableButtons(new Button[] {
         ButtonSelectGroupe, ButtonErace, ButtonEdit, ButtonSelectRoom, ButtonClear, ButtonOpen, ButtonSave
     }, false);
 }
コード例 #4
0
 private void ButtonSave_Click(object sender, EventArgs e)
 {
     if (FlagSelectedRow)
     {
         PresentationLayerClass.SendDataFromStudentTextBox(panel1, FilePath);
         UpdateData(TableName);
         //PresentationLayerClass.ClearControls(this);
         PresentationLayerClass.ClearBeforeCreate(panel1, pictureBox1, dataGridView1);
         PresentationLayerClass.OnlyReadSwitch(panel1, 3, true);
         PresentationLayerClass.EnableDisableButtons(new Button[] {
             ButtonSearch, ButtonDelete, ButtonResetFilters, ButtonCreate, ButtonEdit
         }, true);
         PresentationLayerClass.EnableDisableButtons(new Button[] {
             ButtonSelectGroupe, ButtonErace, ButtonSelectRoom, ButtonSave, ButtonOpen, ButtonClear,
         }, false);
         dataGridView1.Enabled = true;
         ButtonCancelEdit.Hide();
     }
     else
     {
         if (dataGridView1.CurrentRow != null)
         {
             int i = dataGridView1.CurrentRow.Index;
             PresentationLayerClass.SendDataFromStudentTextBox(panel1, FilePath,
                                                               Convert.ToInt32(dataGridView1[0, dataGridView1.CurrentRow.Index].Value.ToString()));
             UpdateData(TableName);
             dataGridView1.CurrentCell = dataGridView1.Rows[i].Cells[0];
             {
                 //dataGridView1.SelectedRows[i].Cells[0];
                 //dataGridView1.Rows[i].Selected = true;
                 //MessageBox.Show(Convert.ToString(dataGridView1.CurrentRow.Index));
                 //-------
             }
             PresentationLayerClass.AddDataToTextBox(panel1, TableName,
                                                     Convert.ToInt32(dataGridView1[0, i].Value.ToString()));
             PresentationLayerClass.GetSetPicture(pictureBox1,
                                                  Convert.ToInt32(dataGridView1[0, i].Value.ToString()));
             FilePath        = null;
             FlagSelectedRow = false;
             PresentationLayerClass.OnlyReadSwitch(panel1, 3, true);
             PresentationLayerClass.EnableDisableButtons(new Button[] {
                 ButtonSearch, ButtonDelete, ButtonResetFilters, ButtonCreate, ButtonEdit
             }, true);
             PresentationLayerClass.EnableDisableButtons(new Button[] {
                 ButtonSelectGroupe, ButtonErace, ButtonSelectRoom, ButtonSave, ButtonOpen, ButtonClear
             }, false);
             dataGridView1.Enabled = true;
             ButtonCancelEdit.Hide();
         }
     }
 }
コード例 #5
0
 private void ButtonEdit_Click(object sender, EventArgs e)
 {
     if (!FlagSelectedRow)
     {
         PresentationLayerClass.EnableDisableButtons(new Button[] {
             ButtonSelectGroupe, ButtonErace, ButtonSelectRoom, ButtonOpen, ButtonSave, ButtonDelete, ButtonClear
         }, true);
         PresentationLayerClass.EnableDisableButtons(new Button[] {
             ButtonDelete, ButtonCreate, ButtonSearch, ButtonResetFilters, ButtonEdit
         }, false);
         PresentationLayerClass.OnlyReadSwitch(panel1, 3, false);
         ButtonCancelEdit.Visible = true;
     }
 }
コード例 #6
0
 private void ButtonCreate_Click(object sender, EventArgs e)
 {
     PresentationLayerClass.EnableDisableButtons(new Button[] {
         ButtonSave, ButtonClear
     }, true);
     PresentationLayerClass.EnableDisableButtons(new Button[] {
         ButtonDelete, ButtonCreate, ButtonEdit
     }, false);
     PresentationLayerClass.OnlyReadSwitch(panel1, 1, false);
     textBox2.ReadOnly        = true;
     dataGridView1.Enabled    = false;
     ButtonCancelEdit.Visible = true;
     PresentationLayerClass.ClearBeforeCreate(panel1);
     FlagSelectedRow = true;
 }
コード例 #7
0
 private void ButtonEdit_Click(object sender, EventArgs e)
 {
     if (!FlagSelectedRow)
     {
         PresentationLayerClass.EnableDisableButtons(new Button[] {
             ButtonSave, ButtonDelete, ButtonClear
         }, true);
         PresentationLayerClass.EnableDisableButtons(new Button[] {
             ButtonDelete, ButtonCreate, ButtonEdit
         }, false);
         PresentationLayerClass.OnlyReadSwitch(panel1, 1, false);
         textBox2.ReadOnly        = true;
         ButtonCancelEdit.Visible = true;
     }
 }
コード例 #8
0
 private void ButtonCreate_Click(object sender, EventArgs e)
 {
     PresentationLayerClass.EnableDisableButtons(new Button[] {
         ButtonSelectGroupe, ButtonErace, ButtonSelectRoom, ButtonOpen, ButtonSave, ButtonClear
     }, true);
     PresentationLayerClass.EnableDisableButtons(new Button[] {
         ButtonDelete, ButtonCreate, ButtonSearch, ButtonResetFilters, ButtonEdit
     }, false);
     PresentationLayerClass.OnlyReadSwitch(panel1, 3, false);
     dataGridView1.Enabled    = false;
     ButtonCancelEdit.Visible = true;
     PresentationLayerClass.ClearBeforeCreate(panel1, pictureBox1, dataGridView1);
     FlagSelectedRow = true;
     textBoxName1.Focus();
 }
コード例 #9
0
        private void ButtonSave_Click(object sender, EventArgs e)
        {
            if (FlagSelectedRow)
            {
                PresentationLayerClass.SendDataFromHostelTextBox(panel1);
                UpdateData(TableName);
                //PresentationLayerClass.ClearControls(this);
                PresentationLayerClass.ClearBeforeCreate(panel1, dataGridView1);
                PresentationLayerClass.OnlyReadSwitch(panel1, 1, true);
                TextBoxRoomsCount.ReadOnly = true;
                PresentationLayerClass.EnableDisableButtons(new Button[] {
                    ButtonDelete, ButtonCreate, ButtonEdit
                }, true);
                PresentationLayerClass.EnableDisableButtons(new Button[] {
                    ButtonSave, ButtonClear,
                }, false);
                dataGridView1.Enabled = true;
                ButtonCancelEdit.Hide();
            }
            else
            {
                if (dataGridView1.CurrentRow != null)
                {
                    int i = dataGridView1.CurrentRow.Index;
                    PresentationLayerClass.SendDataFromHostelTextBox(panel1,
                                                                     Convert.ToInt32(dataGridView1[0, dataGridView1.CurrentRow.Index].Value.ToString()));
                    UpdateData(TableName);
                    dataGridView1.CurrentCell = dataGridView1.Rows[i].Cells[0];

                    PresentationLayerClass.AddDataToTextBox(panel1, TableName,
                                                            Convert.ToInt32(dataGridView1[0, i].Value.ToString()));
                    FlagSelectedRow = false;
                    PresentationLayerClass.OnlyReadSwitch(panel1, 1, true);
                    TextBoxRoomsCount.ReadOnly = true;
                    PresentationLayerClass.EnableDisableButtons(new Button[] {
                        ButtonDelete, ButtonCreate, ButtonEdit
                    }, true);
                    PresentationLayerClass.EnableDisableButtons(new Button[] {
                        ButtonSave, ButtonClear
                    }, false);
                    dataGridView1.Enabled = true;
                    ButtonCancelEdit.Hide();
                }
            }
        }
コード例 #10
0
 private void ButtonCancelEdit_Click(object sender, EventArgs e)
 {
     PresentationLayerClass.ClearBeforeCreate(panel1);
     try
     {
         PresentationLayerClass.AddDataToTextBox(panel1, TableName,
                                                 Convert.ToInt32(dataGridView1[0, dataGridView1.CurrentRow.Index].Value.ToString()));
     }
     catch { }
     FlagSelectedRow          = false;
     ButtonCancelEdit.Visible = false;
     dataGridView1.Enabled    = true;
     PresentationLayerClass.EnableDisableButtons(new Button[] {
         ButtonSave, ButtonDelete, ButtonClear
     }, false);
     PresentationLayerClass.EnableDisableButtons(new Button[] {
         ButtonDelete, ButtonCreate, ButtonEdit
     }, true);
     PresentationLayerClass.OnlyReadSwitch(panel1, 0, true);
     textBox2.ReadOnly = true;
 }
コード例 #11
0
 private void ButtonCancelEdit_Click(object sender, EventArgs e)
 {
     PresentationLayerClass.ClearBeforeCreate(panel1, pictureBox1);
     try
     {
         PresentationLayerClass.AddDataToTextBox(panel1, TableName,
                                                 Convert.ToInt32(dataGridView1[0, dataGridView1.CurrentRow.Index].Value.ToString()));
         PresentationLayerClass.GetSetPicture(pictureBox1,
                                              Convert.ToInt32(dataGridView1[0, dataGridView1.CurrentRow.Index].Value.ToString()));
     }
     catch { }
     FilePath                 = null;
     FlagSelectedRow          = false;
     ButtonCancelEdit.Visible = false;
     dataGridView1.Enabled    = true;
     PresentationLayerClass.EnableDisableButtons(new Button[] {
         ButtonSelectGroupe, ButtonErace, ButtonSelectRoom, ButtonOpen, ButtonSave, ButtonDelete, ButtonClear
     }, false);
     PresentationLayerClass.EnableDisableButtons(new Button[] {
         ButtonDelete, ButtonCreate, ButtonSearch, ButtonResetFilters, ButtonEdit
     }, true);
     PresentationLayerClass.OnlyReadSwitch(panel1, 0, true);
 }