Пример #1
0
        public override XVar processDataInput()
        {
            dynamic newRecordData = null;

            buildNewRecordData();
            if (XVar.Pack(!(XVar)(recheckUserPermissions())))
            {
                this.oldRecordData      = XVar.Clone(this.newRecordData);
                this.cachedRecord       = XVar.Clone(this.newRecordData);
                this.recordValuesToEdit = new XVar(null);
                return(false);
            }
            if (XVar.Pack(!(XVar)(checkCaptcha())))
            {
                setMessage((XVar)(this.message));
                return(false);
            }
            foreach (KeyValuePair <XVar, dynamic> value in this.newRecordData.GetEnumerator())
            {
                if (XVar.Pack(!(XVar)(this.pSet.allowDuplicateValues((XVar)(value.Key)))))
                {
                    this.errorFields.InitAndSetArrayItem(value.Key, null);
                    setMessage((XVar)(MVCFunctions.Concat(this.pSet.label((XVar)(value.Key)), " ", CommonFunctions.mlang_message(new XVar("INLINE_DENY_DUPLICATES")))));
                    return(false);
                }
            }
            newRecordData = XVar.Clone(getNewRecordCopy((XVar)(this.newRecordData)));
            foreach (KeyValuePair <XVar, dynamic> s in this.parsedSelection.GetEnumerator())
            {
                dynamic fetchedArray = null, newRecordDataTemp = null;
                newRecordDataTemp     = XVar.Clone(newRecordData);
                this.newRecordData    = XVar.Clone(getNewRecordCopy((XVar)(newRecordDataTemp)));
                this.currentWhereExpr = XVar.Clone(getSingleRecordWhereClause((XVar)(s.Value)));
                GlobalVars.strSQL     = XVar.Clone(this.gQuery.gSQLWhere((XVar)(this.currentWhereExpr)));
                CommonFunctions.LogInfo((XVar)(GlobalVars.strSQL));
                fetchedArray = XVar.Clone(this.connection.query((XVar)(GlobalVars.strSQL)).fetchAssoc());
                if (XVar.Pack(!(XVar)(fetchedArray)))
                {
                    continue;
                }
                fetchedArray = XVar.Clone(this.cipherer.DecryptFetchedArray((XVar)(fetchedArray)));
                if (XVar.Pack(!(XVar)(isRecordEditable((XVar)(fetchedArray)))))
                {
                    continue;
                }
                setUpdatedLatLng((XVar)(getNewRecordData()), (XVar)(fetchedArray));
                this.oldKeys            = XVar.Clone(s.Value);
                this.recordBeingUpdated = XVar.Clone(fetchedArray);
                if (XVar.Pack(!(XVar)(callBeforeEditEvent())))
                {
                    continue;
                }
                if (XVar.Pack(callCustomEditEvent()))
                {
                    if (XVar.Pack(!(XVar)(MVCFunctions.DoUpdateRecord(this))))
                    {
                        continue;
                    }
                }
                ++(this.nUpdated);
                mergeNewRecordData();
                auditLogEdit((XVar)(s.Value));
                callAfterEditEvent();
                if (XVar.Pack(isPopupMode()))
                {
                    this.inlineReportData.InitAndSetArrayItem(getRowSaveStatusJSON((XVar)(s.Value)), this.rowIds[s.Key]);
                }
            }
            this.updatedSuccessfully = XVar.Clone(0 < this.nUpdated);
            if (XVar.Pack(!(XVar)(this.updatedSuccessfully)))
            {
                return(false);
            }
            this.messageType = new XVar(Constants.MESSAGE_INFO);
            setSuccessfulEditMessage();
            callAfterSuccessfulSave();
            return(true);
        }