Exemplo n.º 1
0
        private bool ExecuteTransaction(string ItemKey)
        {
            string update = "";

            try
            {
                if (_fstiClient.ProcessId(myItem, null))
                {
                    // success, get the response and display it using a list box
                    listResult.Items.Add("Success:");
                    listResult.Items.Add("");
                    listResult.Items.Add(_fstiClient.CDFResponse);
                    update = "UPDATE _CAP_Shipment_Line SET [FSTI_TransactionStatus] = 1,[FSTI_Error] = 0" +
                             ",[FSTI_TransactionMessage] = '" + _fstiClient.CDFResponse + "' WHERE ItemKey=" + ItemKey;
                    Cliente_SQL.Execute_Command(update);
                    couterGood++;
                }
                else
                {
                    // failure, retrieve the error object
                    // and then dump the information in the list box
                    FSTIError itemError = _fstiClient.TransactionError;
                    DumpErrorObject(myItem, itemError);

                    update = "UPDATE _CAP_Shipment_Line SET [FSTI_TransactionStatus] = 1" +
                             ",[FSTI_Error] = 1" +
                             ",[FSTI_TransactionMessage] = 'Error: " + itemError.Description +// " Transaction: "+myItem.GetString(TransactionStringFormat.fsCDF)+
                             "' WHERE ItemKey=" + ItemKey;
                    Cliente_SQL.Execute_Command(update);
                    counterBad++;
                    errors.Add("Part Number: " + myItem.ItemNumber.Value.ToString() + " Error Message: " + itemError.Description);
                }
                return(false);
            }
            catch (Exception ex)
            {
                StopServer();


                string EmailTo = "*****@*****.**";
                string Subject = "FS Movements Error " + DateTime.Now.ToString("MM-dd-yyy hh-mm");;

                //AlternateView body=
                string Body = "Server Error: " + ex.Message;
                mail.CreateMessage(EmailTo, Subject, Body);
                mail.SendEmail();

                //MessageBox.Show(ex.Message,"Server Error");
                return(true);
            }
        }
Exemplo n.º 2
0
 private void FSTI_Execute()
 {
     _fstiClient.ProcessId(_Trans, null);
 }