Exemple #1
0
 public string GetAttachments(string ID)
 {
     try
     {
         List <FileUpload> AttachmentList = new List <FileUpload>();
         AttachmentList = _fileUploadBusiness.GetAttachments(Guid.Parse(ID));
         return(JsonConvert.SerializeObject(new { Result = "OK", Records = AttachmentList }));
     }
     catch (Exception ex)
     {
         //AppConstMessage cm = c.GetMessage(ex.Message);
         return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = ex.Message }));
     }
 }
 public string GetAttachments(string ID)
 {
     try
     {
         List <FileUpload> AttachmentList = new List <FileUpload>();
         AttachmentList = _fileUploadBusiness.GetAttachments(Guid.Parse(ID));
         AppUA appUA = Session["AppUA"] as AppUA;
         if (AttachmentList != null)
         {
             foreach (FileUpload item in AttachmentList)
             {
                 item.IsDocLocked = item.DocumentOwners.Contains(appUA.UserName);
                 string[] owner = ((!string.IsNullOrEmpty(ConfigurationManager.AppSettings["owners"])) ? ConfigurationManager.AppSettings["owners"].Split(',') : null);
                 if ((owner != null) && (owner.Any(item.ParentType.Equals)))
                 {
                     item.IsDocLocked = true;
                 }
                 if (item.ParentType == "Quotation" || item.ParentType == "SaleOrder" || item.ParentType == "ProductionOrder" || item.ParentType == "ProformaInvoice")
                 {
                     switch (item.ParentType)
                     {
                     case "Quotation":
                     case "SaleOrder":
                     case "ProformaInvoice":
                     case "ProductionOrder":
                         //item.IsDocumentApprover= _approverBusiness.CheckIsDocumentOwner("QUO", appUA.UserName);
                         item.IsDocumentApprover = true;
                         break;
                     }
                 }
             }
         }
         return(JsonConvert.SerializeObject(new { Result = "OK", Records = AttachmentList }));
     }
     catch (Exception ex)
     {
         //AppConstMessage cm = c.GetMessage(ex.Message);
         return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = ex.Message }));
     }
 }