Esempio n. 1
0
        protected void fviewItemUpdating(object sender, FormViewUpdateEventArgs e)
        {
            var uid        = (int)fview.DataKey.Value;
            var dataobject = new FatturaFormDataObject(uid);

            dataobject.Intestatario = ((TextBox)fview.FindControl("dataIntestatario")).Text;
            dataobject.Descrizione  = ((TextBox)fview.FindControl("dataDescrizione")).Text;
            dataobject.Numero       = ((TextBox)fview.FindControl("dataNumero")).Text;
            dataobject.Data         = ((TextBox)fview.FindControl("dataData")).Text;

            // write custom item update code here

            fview.ChangeMode(FormViewMode.ReadOnly);
            try
            {
                presenter.Update(dataobject);
                if (Action != null)
                {
                    Action(this, new FormActionEventArgs(FormAction.Inserted, this.UId));
                }
            }
            catch (Exception ex)
            {
                e.Cancel = true;
                controlMessage.ShowErrorMessage(ex.Message);
            }
        }
Esempio n. 2
0
 public void Update(FatturaFormDataObject dataobject)
 {
     ((GenTest.BOM.Fattura)dataobject).Commit();
     view.DataObject = dataobject;
 }