private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (devicenum > gridView1.RowCount || devicenum == 0) { Ps_Table_TZMX px = new Ps_Table_TZMX(); FormTZGSXXdialog fd = new FormTZGSXXdialog(); fd.type = type; fd.volt = volt; fd.buildyear = Convert.ToInt32(buildyear); fd.buildend = Convert.ToInt32(buildend); fd.tzmx = px; fd.ShowDialog(); if (fd.DialogResult == DialogResult.OK) { Ps_Table_TZMX pt = fd.tzmx; pt.ProjectID = pid; pt.Typeqf = type; pt.BuildYear = buildyear; pt.BuildEnd = buildend; Services.BaseService.Create <Ps_Table_TZMX>(pt); } initdata(); } else { MessageBox.Show("变电站的数目已经达到!"); return; } }
private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (FocusedObject != null) { FormTZGSXXdialog ft = new FormTZGSXXdialog(); ft.type = type; ft.volt = volt; ft.buildyear = Convert.ToInt32(buildyear); ft.buildend = Convert.ToInt32(buildend); ft.tzmx = FocusedObject; ft.ShowDialog(); if (ft.DialogResult == DialogResult.OK) { Services.BaseService.Update("UpdatePs_Table_TZMX", ft.tzmx); } initdata(); } else { MessageBox.Show("请选择一行数据!"); return; } }
private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (FocusedObject!=null) { FormTZGSXXdialog ft = new FormTZGSXXdialog(); ft.type = type; ft.volt = volt; ft.buildyear = Convert.ToInt32(buildyear); ft.buildend = Convert.ToInt32(buildend); ft.tzmx = FocusedObject; ft.ShowDialog(); if (ft.DialogResult==DialogResult.OK) { Services.BaseService.Update("UpdatePs_Table_TZMX",ft.tzmx); } initdata(); } else { MessageBox.Show("��ѡ��һ�����ݣ�"); return; } }
private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (devicenum>gridView1.RowCount||devicenum==0) { Ps_Table_TZMX px = new Ps_Table_TZMX(); FormTZGSXXdialog fd = new FormTZGSXXdialog(); fd.type = type; fd.volt = volt; fd.buildyear =Convert.ToInt32(buildyear); fd.buildend =Convert.ToInt32(buildend) ; fd.tzmx = px; fd.ShowDialog(); if (fd.DialogResult==DialogResult.OK) { Ps_Table_TZMX pt = fd.tzmx; pt.ProjectID = pid; pt.Typeqf = type; pt.BuildYear = buildyear; pt.BuildEnd = buildend; Services.BaseService.Create<Ps_Table_TZMX>(pt); } initdata(); } else { MessageBox.Show("���վ����Ŀ�Ѿ��ﵽ!"); return; } }