Exemplo n.º 1
0
        /// <summary>
        /// Updates the status with "Success" or Failure" once the printing is done.
        /// </summary>
        /// <param name="rowId">The row Id which needs to be updated</param>
        /// <param name="statusString">The string value indicating status.</param>
        public void UpdatePrintingStatus(string rowId, string statusString)
        {
            DocumentPrintingStatusContract status = this.documentStatuses.FirstOrDefault(s => s.Id == rowId);

            if (status != null)
            {
                status.Status         = statusString;
                status.StatusDateTime = DateTime.Now;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Adds the printing status in the Table
        /// </summary>
        /// <param name="statusContract">The status contract.</param>
        public void AddPrintingStatus(DocumentPrintingStatusContract statusContract)
        {
            // To make sure tha the number of document printing status is no more than max number of rows.
            if (this.documentStatuses.Count >= this.maxNumberOfRows)
            {
                this.documentStatuses.RemoveAt(this.maxNumberOfRows - 1);
            }

            statusContract.StatusDateTime = DateTime.Now;
            this.documentStatuses.Insert(0, statusContract);
        }
        private void AddPrintingStatus(string printerPath, IDocumentContract document, Notification notification)
        {
            var status = new DocumentPrintingStatusContract
            {
                Id           = notification.JobId,
                DocumentName = document.Name,
                PrinterName  = printerPath,
                Status       = DocumentStatus.Pending.ToString()
            };

            this.documentStatusManager.AddPrintingStatus(status);
        }