private void razdelitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DataGridView grid = (DataGridView)contextMenuStripCELL.SourceControl;

            if (grid.SelectedRows.Count == 1)
            {
                DataRowView curent_row        = (DataRowView)grid.SelectedRows[0].DataBoundItem;
                ___BASA__DataSet.ZurnalRow cr = (___BASA__DataSet.ZurnalRow)curent_row.Row;
                DelimVremya dv         = new DelimVremya();
                int         curent_per = dv.periodDefault = cr.period;
                dv.startTime = cr.time;
                dv.Tag       = this;
                if (dv.ShowDialog() == DialogResult.OK)
                {
                    cr.period = new_per_delim;
                    if (where_zap_whill_delim)
                    {
                        ___BASA__DataSet.Zurnal.AddZurnalRow(data_new_delim, curent_per - new_per_delim, (int)grid.Tag, "", cr.dataZap, 0, "", "");
                    }
                    else
                    {
                        ___BASA__DataSet.Zurnal.AddZurnalRow(data_new_delim, curent_per - new_per_delim, (int)grid.Tag, cr.zap, cr.dataZap, cr.PID, cr.PS, cr.zapTag);
                        cr.PID = 0; cr.zapTag = ""; cr.zap = ""; cr.PS = "";
                    }
                    setupDATESadd(cr.dataZap, cr.DID);
                }
            }
        }
Exemplo n.º 2
0
        private void delimTimeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DataGridView grid = (DataGridView)contextMenuStripCELL.SourceControl;

            if (grid.SelectedRows.Count == 1)
            {
                DataRowView curent_row            = (DataRowView)grid.SelectedRows[0].DataBoundItem;
                ___BASA__DataSet.raspisanieRow cr = (___BASA__DataSet.raspisanieRow)curent_row.Row;
                DelimVremya dv         = new DelimVremya();
                int         curent_per = dv.periodDefault = cr.period;
                dv.startTime = cr.time;
                dv.Tag       = this;
                if (dv.ShowDialog() == DialogResult.OK)
                {
                    cr.period = new_per1;

                    ___BASA__DataSet.raspisanieRow nR = ___BASA__DataSet.raspisanie.NewraspisanieRow();
                    nR.time   = data_new_delimRasCh;
                    nR.period = curent_per - new_per1;
                    nR.dow    = cr.dow;
                    nR.DID    = cr.DID;
                    nR.whenID = cr.whenID;
                    if (where_zapDelim)
                    {
                        nR.zap = nR.zapTag = "";
                    }
                    else
                    {
                        nR.zap    = cr.zap;
                        nR.zapTag = cr.zapTag;
                        cr.zapTag = ""; cr.zap = "";
                    }
                    ___BASA__DataSet.raspisanie.AddraspisanieRow(nR);
                }
            }
        }