Beispiel #1
0
 private void toolStripButton19_Click(object sender, EventArgs e)
 {
     Bill _Bill = new Bill();
     _Bill.Create();
     billsTableAdapter.Fill(tDayDataSet.Bills);
 }
Beispiel #2
0
 private void button4_Click(object sender, EventArgs e)
 {
     Bill _Bill = new Bill();
     billsTableAdapter.Fill(tDayDataSet.Bills);
     tabControl1.SelectedTab = Bills;
     richTextBox1.Text = TDay.Properties.Settings.Default.PlantString;
     richTextBox1.SelectAll();
     richTextBox1.SelectionAlignment = HorizontalAlignment.Center;
     richTextBox2.SelectAll();
     richTextBox2.SelectionAlignment = HorizontalAlignment.Center;
     daysBindingSource2.Filter = "ProfileId=-1";
     daysTableAdapter.FillByMonth(tDayDataSet.Days, _Bill.FirstDayOfMonth, _Bill.LastDayOfMonth);
     dataGridView6.Sort(dateDataGridViewTextBoxColumn2, ListSortDirection.Ascending);
     profilesTableAdapter.FillAll(tDayDataSet.Profiles);
     if (dataGridView5.Rows.Count > 0)
     {
         dataGridView5_CellClick(sender,new DataGridViewCellEventArgs(0,0));
     }
 }
Beispiel #3
0
        private void toolStripButton12_Click(object sender, EventArgs e)
        {
            if (dataGridView7.SelectedCells.Count > 0)
            {
                TDayDataSet tempSet = new TDayDataSet();
                Bill _Bill = new Bill();
                billsTableAdapter.FillByMonth(tempSet.Bills, _Bill.FirstDayOfMonth, _Bill.LastDayOfMonth);
                int Index = -1;
                foreach (DataRow Row in tempSet.Bills)
                {
                    if ((int)Row["ProfileId"] == (int)dataGridView7.Rows[dataGridView7.SelectedCells[0].RowIndex].Cells["dataGridViewTextBoxColumn1"].Value)
                    {
                        Index = (int)Row["BillId"];
                            break;
                    }
                }
                if (Index != -1)
                {
                    panel8.Visible = false;
                    foreach (DataGridViewRow Row in dataGridView5.Rows)
                    {
                        if ((int)Row.Cells["billIdDataGridViewTextBoxColumn"].Value == Index)
                        {
                            DataGridViewCellEventArgs eve = new DataGridViewCellEventArgs(0, Row.Index);
                            dataGridView5_CellClick(sender, eve);
                            dataGridView5.Rows[Row.Index].Selected = true;
                            break;
                        }
                    }
                }
                else
                {
                    BillsItem item = new BillsItem((int)dataGridView7.Rows[dataGridView7.SelectedCells[0].RowIndex].Cells["dataGridViewTextBoxColumn1"].Value, _Bill.FirstDayOfMonth, _Bill.LastDayOfMonth);
                    item.Insert();
                    billsTableAdapter.Fill(tDayDataSet.Bills);
                    panel8.Visible = false;
                    dataGridView7.Rows[dataGridView7.Rows.Count - 1].Selected = true;
                }

            }
        }