コード例 #1
0
 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); }
 }
コード例 #2
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);
        }
コード例 #3
0
        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);
        }