private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { PDtypefrmedit PDT = new PDtypefrmedit(); if (PDT.ShowDialog() == DialogResult.OK) { PDrelregion pdr = new PDrelregion(); pdr.ProjectID = Itop.Client.MIS.ProgUID; pdr.PeopleSum = PDT.Peplesum; pdr.AreaName = PDT.Areaname; pdr.Year = PDT.Year; Services.BaseService.Create <PDrelregion>(pdr); dataTable.Rows.Add(Itop.Common.DataConverter.ObjectToRow(pdr, dataTable.NewRow())); //init(); } }
private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (treeList1.FocusedNode == null) { return; } TreeListNode tn = treeList1.FocusedNode; DataRow[] dr = dataTable.Select("ID='" + tn["ID"].ToString() + "'"); PDtypefrmedit PDT = new PDtypefrmedit(); if (dr[0] != null) { PDT.Pdtype = Itop.Common.DataConverter.RowToObject <PDrelregion>(dr[0]); } if (PDT.ShowDialog() == DialogResult.OK) { Services.BaseService.Update <PDrelregion>(PDT.Pdtype); treeList1.FocusedNode.SetValue("AreaName", PDT.Areaname); treeList1.FocusedNode.SetValue("PeopleSum", PDT.Peplesum); } }
private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (treeList1.FocusedNode == null) return; TreeListNode tn=treeList1.FocusedNode; DataRow[] dr=dataTable.Select("ID='"+tn["ID"].ToString()+"'"); PDtypefrmedit PDT = new PDtypefrmedit(); if (dr[0]!=null) { PDT.Pdtype = Itop.Common.DataConverter.RowToObject<PDrelregion>(dr[0]); } if (PDT.ShowDialog() == DialogResult.OK) { Services.BaseService.Update<PDrelregion>(PDT.Pdtype); treeList1.FocusedNode.SetValue("AreaName", PDT.Areaname); treeList1.FocusedNode.SetValue("PeopleSum", PDT.Peplesum); } }
private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { PDtypefrmedit PDT = new PDtypefrmedit(); if (PDT.ShowDialog()==DialogResult.OK) { PDrelregion pdr = new PDrelregion(); pdr.ProjectID = Itop.Client.MIS.ProgUID; pdr.PeopleSum = PDT.Peplesum; pdr.AreaName = PDT.Areaname; pdr.Year = PDT.Year; Services.BaseService.Create<PDrelregion>(pdr); dataTable.Rows.Add(Itop.Common.DataConverter.ObjectToRow(pdr, dataTable.NewRow())); //init(); } }