private void xamDataGrid_EditModeEnded(object sender, Infragistics.Windows.DataPresenter.Events.EditModeEndedEventArgs e) { // use this method to update a record after one of the cells of the record has been edited if (((string)e.Cell.Record.Tag) == "AddRecord") { return; // not updating the AddRecord here } if (e.Cell.Record.DataItem.GetType() == typeof(PlateTypeItem)) { PlateTypeItem pti = (PlateTypeItem)e.Cell.Record.DataItem; if (pti.PlateType.PlateTypeID != 0) { bool success = wgDB.UpdatePlateType(pti.PlateType); } } else if (e.Cell.Record.DataItem.GetType() == typeof(MaskContainer)) { MaskContainer mc = (MaskContainer)e.Cell.Record.DataItem; if (mc.MaskID != 0) { bool succcess = wgDB.UpdateMask(mc); } } }
private void xamDataGrid_EditModeEnded(object sender, Infragistics.Windows.DataPresenter.Events.EditModeEndedEventArgs e) { // use this method to update a record after one of the cells of the record has been edited if (((string)e.Cell.Record.Tag) == "AddRecord") { return; // not updating the AddRecord here } if (e.Cell.Record.DataItem.GetType() == typeof(MethodItem)) { MethodItem mi = (MethodItem)e.Cell.Record.DataItem; if (mi.MethodID != 0) { MethodContainer mc = new MethodContainer(); mc.MethodID = mi.MethodID; mc.Description = mi.Description; mc.BravoMethodFile = mi.BravoMethodFile; mc.OwnerID = mi.OwnerID; mc.IsPublic = mi.IsPublic; bool success = wgDB.UpdateMethod(mc); } } else if (e.Cell.Record.DataItem.GetType() == typeof(IndicatorItem)) { IndicatorItem ii = (IndicatorItem)e.Cell.Record.DataItem; if (ii.IndicatorID != 0) { IndicatorContainer ic = new IndicatorContainer(); ic.Description = ii.Description; ic.MethodID = ii.MethodID; ic.IndicatorID = ii.IndicatorID; ic.ExcitationFilterPosition = ii.ExcitationFilterPosition; ic.EmissionsFilterPosition = ii.EmissionsFilterPosition; ic.SignalType = ii.SignalType; bool succcess = wgDB.UpdateIndicator(ic); } } else if (e.Cell.Record.DataItem.GetType() == typeof(CompoundPlateItem)) { CompoundPlateItem cpi = (CompoundPlateItem)e.Cell.Record.DataItem; if (cpi.CompoundPlateID != 0) { CompoundPlateContainer cpc = new CompoundPlateContainer(); cpc.CompoundPlateID = cpi.CompoundPlateID; cpc.MethodID = cpi.MethodID; cpc.Description = cpi.Description; bool success = wgDB.UpdateCompoundPlate(cpc); } } }
private void xamDataGrid_EditModeEnded(object sender, Infragistics.Windows.DataPresenter.Events.EditModeEndedEventArgs e) { // use this method to update a record after one of the cells of the record has been edited if (((string)e.Cell.Record.Tag) == "AddRecord") { return; // not updating the AddRecord here } PlateTypeContainer pt = (PlateTypeContainer)e.Cell.Record.DataItem; if (ValidateData(pt)) { if (pt.PlateTypeID != 0) // if PlateTypeID != 0 then we know that this PlateType is already in the database, so we can call Update { bool success = wgDB.UpdatePlateType(pt); } } }