Exemple #1
0
        public string UploadMail(RequestObject requestObject, Client client, ServiceRequest serviceRequest)
        {
            string message = string.Empty;
            string result  = "True";

            if (null != requestObject && null != client && null != serviceRequest && ValidationHelperFunctions.CheckRequestValidatorToken())
            {
                if (UploadHelperFunctions.Upload(requestObject, client, serviceRequest, ServiceConstantStrings.MailSoapRequest, serviceRequest.MailId, true, serviceRequest.Subject, serviceRequest.FolderPath[0], true, ref message, string.Empty).Equals(ConstantStrings.UploadFailed))
                {
                    if (!string.IsNullOrEmpty(message))
                    {
                        result = message;
                    }
                    else
                    {
                        result = "False";
                    }
                }
            }
            else
            {
                result = TextConstants.MessageNoInputs;
            }
            return(result);
        }
Exemple #2
0
        public string UploadAttachment(RequestObject requestObject, Client client, ServiceRequest serviceRequest)
        {
            string resultFlag = string.Empty;

            if (null != requestObject && null != client && null != serviceRequest && ValidationHelperFunctions.CheckRequestValidatorToken())
            {
                ///// check if folder path and attachment length are same
                if (serviceRequest.FolderPath.Count == serviceRequest.Attachments.Count)
                {
                    bool result = true;
                    ///// StringBuilder builder = new StringBuilder();
                    int    attachmentCount = 0;
                    string message         = string.Empty;
                    foreach (AttachmentDetails attachment in serviceRequest.Attachments)
                    {
                        if (UploadHelperFunctions.Upload(requestObject, client, serviceRequest, ServiceConstantStrings.AttachmentSoapRequest, attachment.id, false, attachment.name, serviceRequest.FolderPath[attachmentCount], true, ref message, attachment.originalName).Equals(ConstantStrings.UploadFailed))
                        {
                            result = false;
                            break;
                        }

                        attachmentCount++;
                    }

                    if (result)
                    {
                        resultFlag = "True";
                    }
                    else if (!string.IsNullOrEmpty(message))
                    {
                        resultFlag = message;
                    }
                    else
                    {
                        resultFlag = "False";
                    }
                }
                else
                {
                    resultFlag = "False";
                }
            }
            else
            {
                resultFlag = TextConstants.MessageNoInputs;
            }
            return(resultFlag);
        }