public void BindFormView(FormView fv, List <WACParameter> parms, MasterDetailDataObject.ItemGetterDelegate _getItem) { try { fv.DataKeyNames = ListSource.DataKeyNames; fv.DataSource = ListSource.GetSingleItemList(parms, _getItem); fv.DataBind(); } catch (Exception ex) { WACAlert.Show(ex.Message + " In " + this.ToString() + ".BindFormView", 0); } }
public void ReturnToViewMode(WACFormControl form) { FormView fv = WACGlobal_Methods.FindControl <FormView>(form); fv.ChangeMode(FormViewMode.ReadOnly); fv.DataSource = ListSource.GetSingleItemList(); fv.DataBind(); ShowModal(form, true); ContentStateChanged(form); }
public bool Delete <T>(List <WACParameter> parms) { bool result = false; try { if (UserAuthorized("Delete", AuthorizationArea)) { IList li = ListSource.GetSingleItemList(parms, DataProvider.GetItem); T item = (T)li[0]; ((IWACDataProvider <T>)DataProvider).Delete(item); ListSource.RemoveItemFromViewlist <T>(item); result = true; } } catch (Exception ex) { WACAlert.Show("Delete failed: " + ex.Message + " In " + this.ToString() + ".Delete", 0); } return(result); }