private void DgvComplexDC_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { DGVt dg = (DGVt)sender; int idopred = (int)dg.Rows[e.RowIndex].Cells["IdOpred"].Value; my.Nbut = 141; //if (!my.isFormInMdi("frmSprDgv", my.Nbut, this)) //{ frmSprDGV fr = new frmSprDGV(); fr.Tag = (int)my.Nbut; fr.Withup = false; fr.MdiParent = my.MDIForm; my.Szap = " and idopred = " + idopred.ToString(); if ((int)idOSR.SelectedValue == 0) { my.Szap = my.Szap + " and idcomplex = " + idComplex.SelectedValue.ToString(); } else { my.Szap = my.Szap + " and idOSR = " + idOSR.SelectedValue.ToString(); } fr.Show(); //} }
private void ToolStripButton1_Click(object sender, EventArgs e) { my.Nbut = 18; my.Szap = ""; //" and PeriodKS2 = '" + my.Uper + "'"; frmSprDGV fr = new frmSprDGV(); fr.Withup = false; fr.Tag = my.Nbut; fr.Pform = this; fr.Show(); }
public static void showSprDGV(int nbut, bool Withup, bool WithSize) { SMRC.Forms.frmSprDGV fr = new SMRC.Forms.frmSprDGV(); fr.MdiParent = MDIForm; if (WithSize) { fr.Dock = DockStyle.Fill; } fr.Withup = Withup; fr.Show(); fr.Tag = nbut; //if (WithSize) //{ // int h = fr.Height; // fr.Dock = DockStyle.None; // fr.Height = h; //} //fr.Left = (int)(MDIForm.Width - fr.Width) / 2; }
private void Dgv1_CellClick(object sender, DataGridViewCellEventArgs e) { try { if (Dgv1.CurrentCell.OwningColumn.Name == "but") { my.Nbut = 128; //if (!my.isFormInMdi("frmSprDgv", my.Nbut, this)) //{ frmSprDGV fr = new frmSprDGV(); fr.Tag = (int)my.Nbut; fr.Withup = false; fr.MdiParent = my.MDIForm; my.Szap = " and idsm = " + Dgv1.CurrentRow.Cells[0].Value.ToString(); fr.Show(); } if (Dgv1.CurrentRow != null) { my.cn.Open(); my.sc.CommandText = my.FilterSel(126, this, my.sconn, " and sprav.dbo.tsmeti.idsm = " + Dgv1.CurrentRow.Cells[0].Value.ToString()); SqlDataReader sd = my.sc.ExecuteReader(); while (sd.Read()) { this.label12.Text = "Освоено по смете(91г): Стр.раб. " + sd["VSr91"].ToString() + ", Монт.раб. " + sd["VMr91"].ToString() + ", Обор. " + sd["VOb91"].ToString() + ", Пр.раб. " + sd["VPr91"].ToString() + ", Итого " + sd["V91"].ToString(); } sd.Close(); my.cn.Close(); } } catch (Exception ex) { MessageBox.Show(ex.Message); if ((int)my.cn.State == 1) { my.cn.Close(); } //throw; } //MessageBox.Show(Dgv1.CurrentRow.Cells[2].Value.ToString()); //} }