private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { int rowhandle = this.gridView1.FocusedRowHandle; Models.v_depotin_crude depotinCrude = new Models.v_depotin_crude(); depotinCrude.productiondate = Convert.ToDateTime(this.gridView1.GetRowCellValue(rowhandle, "productiondate")); depotinCrude.cost = Convert.ToDecimal(this.gridView1.GetRowCellValue(rowhandle, "cost")); depotinCrude.dutyperson = Convert.ToString(this.gridView1.GetRowCellValue(rowhandle, "dutyperson")); depotinCrude.deliveryman = Convert.ToString(this.gridView1.GetRowCellValue(rowhandle, "deliveryman")); depotinCrude.tel = Convert.ToString(this.gridView1.GetRowCellValue(rowhandle, "tel")); depotinCrude.driver = Convert.ToString(this.gridView1.GetRowCellValue(rowhandle, "driver")); depotinCrude.platenum = Convert.ToString(this.gridView1.GetRowCellValue(rowhandle, "platenum")); depotinCrude.depotinid = Convert.ToInt32(this.gridView1.GetRowCellValue(rowhandle, "depotinid")); if (e.Button.Index == 0) { MyForm.More.jinxiaocunManage.EidtrukuForm eidtruku = new MyForm.More.jinxiaocunManage.EidtrukuForm(depotinCrude,1); eidtruku.StartPosition = FormStartPosition.CenterScreen; eidtruku.ShowDialog(); }else if (e.Button.Index == 1) { this.Controls.Remove(this.tableLayoutPanel1); MyControl.More.jinxiaocunManage.detailrukuControl detailruku = new detailrukuControl(Convert.ToInt32(depotinCrude.depotinid)); detailruku.Dock = DockStyle.Fill; this.Controls.Add(detailruku); } RefreshGridList(); }
private void btn_add_Click(object sender, EventArgs e) { Models.v_depotin_crude depotinCrude = new Models.v_depotin_crude(); MyForm.More.jinxiaocunManage.EidtrukuForm eidtruku = new MyForm.More.jinxiaocunManage.EidtrukuForm(depotinCrude,2); eidtruku.StartPosition = FormStartPosition.CenterScreen; eidtruku.ShowDialog(); }