Ejemplo n.º 1
0
        public ConfirmationList BuildConfirmationList(string idColumnName)
        {
            if (idColumnName.IsEmpty())
            {
                return(null);
            }

            ConfirmationList confirmationList = new ConfirmationList();

            XmlNodeList records = this.XmlData.SelectNodes("records/*/record");

            foreach (XmlNode node in records)
            {
                XmlNode keyNode = node.SelectSingleNode(idColumnName);

                if (keyNode.InnerText.IsEmpty())
                {
                    throw new InvalidOperationException("No id in submitted record");
                }

                confirmationList.Add(keyNode.InnerText, new ConfirmationRecord(false, keyNode.InnerText));
            }

            return(confirmationList);
        }
Ejemplo n.º 2
0
        private void DoSaving(string jsonData, XmlNode callbackParameters)
        {
            changingEventArgs = new BeforeStoreChangedEventArgs(jsonData, null, callbackParameters);

            ConfirmationList confirmationList = null;

            if (this.UseIdConfirmation && this.Reader.Reader != null)
            {
                confirmationList = changingEventArgs.DataHandler.BuildConfirmationList(GetIdColumnName());
            }

            changingEventArgs.ConfirmationList = confirmationList;

            this.OnBeforeStoreChanged(changingEventArgs);

            Exception ex = null;

            try
            {
                if (!changingEventArgs.Cancel)
                {
                    this.MakeChanges();
                }
            }
            catch (Exception e)
            {
                ex = e;
            }

            AfterStoreChangedEventArgs eStoreChanged = new AfterStoreChangedEventArgs(true, ex, confirmationList);

            this.OnAfterStoreChanged(eStoreChanged);

            if (eStoreChanged.Exception != null && !eStoreChanged.ExceptionHandled)
            {
                throw new Exception(ex.Message, ex);
            }
        }
 public BeforeStoreChangedEventArgs(string jsonData, ConfirmationList confirmationList, XmlNode callbackParams)
     : this(jsonData, confirmationList)
 {
     this.ajaxPostBackParams = callbackParams;
 }
 public BeforeStoreChangedEventArgs(string jsonData, ConfirmationList confirmationList)
 {
     this.jsonData         = jsonData;
     this.cancel           = false;
     this.confirmationList = confirmationList;
 }
Ejemplo n.º 5
0
 public AfterStoreChangedEventArgs(bool success, Exception exception, ConfirmationList confirmationList)
 {
     this.exception        = exception;
     this.confirmationList = confirmationList;
     this.success          = success;
 }