Exemplo n.º 1
0
 private void ReOpenAnInboundDocument()
 {
     string docId = "";
     try
     {
         myTimer.Stop();
         InputBoxResult result = InputBox.Show("Inbound Doc ID:", "Re-Open Inbound Document", docId, null);
         if (result.OK)
         {
             Int32 inbDocsId = Convert.ToInt32(result.Text);
             string docStatus = AssociatedDoc.OPEN;
             Int32 rowsUpdated = 0;
             InboundDocsDal inboundDocsDal = new InboundDocsDal(sqlConnectionStr);
             rowsUpdated = inboundDocsDal.UpdateStatus(inbDocsId, docStatus);
             if (rowsUpdated == 0)
                 //throw new Exception("Error re-opening Inbound Document ID:" + inbDocsId.ToString());
                 throw new Exception("An error occurred while re-opening Inbound Document Id:" + inbDocsId.ToString() + Environment.NewLine +
                     "Error CNF-194 in " + FORM_NAME + ".ReOpenAnInboundDocument()");
         }
     }
     catch (Exception ex)
     {
         //XtraMessageBox.Show("Exception in Re-Open Inbound Document: " + ex.Message);
         XtraMessageBox.Show("An error occurred while attempting to Re-Open an Inbound Document." + Environment.NewLine +
             "Error CNF-195 in " + FORM_NAME + ".ReOpenAnInboundDocument(): " + ex.Message,
           MAIN_FORM_ERROR_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     finally
     {
         myTimer.Start();
     }
 }
Exemplo n.º 2
0
        private void ReOpenInboundDocument(long inbDocId)
        {            
            var inboundDocsDal = new InboundDocsDal(sqlConnectionString);
            var id = Convert.ToInt32(inbDocId);
            var rowsUpdated = inboundDocsDal.UpdateStatus(id, AssociatedDoc.OPEN);

            if (rowsUpdated <= 0)
            {                
                throw new Exception("An error occurred while re-opening inbound document Id: " + inbDocId + "." + Environment.NewLine +
                     "Error CNF-444 in " + FORM_NAME + ".ReOpenInboundDocument().");
            }

            var dataRow = MasterInboundDocsTable.Rows.Find(id);
            dataRow["DocStatusCode"] = AssociatedDoc.OPEN;
        }