示例#1
0
            public SqlParameters(FolderRule rule)
            {
                modeValue = "null";
                if (rule.Mode == FolderRuleMode.MessageSent)
                {
                    modeValue = "1";
                }
                if (rule.Mode == FolderRuleMode.MessageReceived)
                {
                    modeValue = "2";
                }

                folderValue = (rule.Folder == null ? "null" : rule.Folder.ID.ToString());
                idValue     = rule.ID.ToString();

                messageFromValue = "null";
                if (rule.optMessageFrom.Enabled && rule.optMessageFrom.Validate(false))
                {
                    messageFromValue = rule.optMessageFrom.Employee.ID.ToString();
                }

                messageToValue = "null";
                if (rule.optMessageTo.Enabled && rule.optMessageTo.Validate(false))
                {
                    messageToValue = rule.optMessageTo.Employee.ID.ToString();
                }

                signedByValue = "null";
                if (rule.optSignedBy.Enabled && rule.optSignedBy.Validate(false))
                {
                    signedByValue = rule.optSignedBy.Employee.ID.ToString();
                }

                documentTypeValue = "null";
                modeDocTypeValue  = "3";
                if (rule.optDocumentType.Enabled && rule.optDocumentType.Validate(false))
                {
                    documentTypeValue = rule.optDocumentType.Type.ID.ToString();
                    modeDocTypeValue  = rule.optDocumentType.Filter.ToString();
                }

                personValue = "null";
                if (rule.optPerson.Enabled && rule.optPerson.Validate(false))
                {
                    personValue = rule.optPerson.Person.ID.ToString();
                }

                documentValue = "null";
                if (rule.optDocument.Enabled && rule.optDocument.Validate(false))
                {
                    documentValue = rule.optDocument.Document.ID.ToString();
                }

                messageTextValue = "null";
                if (rule.optMessageText.Enabled && rule.optMessageText.Validate(false))
                {
                    messageTextValue = "'" + (new KString(rule.optMessageText.Text)).SqlEscaped + "'";
                }

                noDocumentValue = "null";
                if (rule.optNoDocument.Enabled && rule.optNoDocument.Validate(false))
                {
                    noDocumentValue = rule.optNoDocument.Document.ID.ToString();
                }

                notSignedByValue = "null";
                if (rule.optNotSignedBy.Enabled && rule.optNotSignedBy.Validate(false))
                {
                    notSignedByValue = rule.optNotSignedBy.Employee.ID.ToString();
                }

                noPersonValue = "null";
                if (rule.optNoPerson.Enabled && rule.optNoPerson.Validate(false))
                {
                    noPersonValue = rule.optNoPerson.Person.ID.ToString();
                }

                nameValue = "'" + (new KString(rule.Name)).SqlEscaped + "'";
            }
示例#2
0
 public override void DB_Update(Base originalObject, SqlTransaction tran)
 {
     originalObject = new FolderRule(ID);
     base.DB_Update(originalObject, tran);
 }