Exemple #1
0
        public FindBulkToolsByDateMatchDataSet FindBulkToolsByDateMatch(DateTime datSignOutDate)
        {
            try
            {
                aFindBulkToolsByDateMatchDataSet      = new FindBulkToolsByDateMatchDataSet();
                aFindBulkToolsbyDateMatchTableAdapter = new FindBulkToolsByDateMatchDataSetTableAdapters.FindBulkToolsByDateMatchTableAdapter();
                aFindBulkToolsbyDateMatchTableAdapter.Fill(aFindBulkToolsByDateMatchDataSet.FindBulkToolsByDateMatch, datSignOutDate);
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Bulk Tools Class // Find Bulk Tools By Date Match " + Ex.Message);
            }

            return(aFindBulkToolsByDateMatchDataSet);
        }
        private void mitSignOutBulkTool_Click(object sender, RoutedEventArgs e)
        {
            string   strIssueNotes;
            bool     blnFatalError   = false;
            string   strErrorMessage = "";
            string   strValueForValidation;
            int      intQuantity        = 0;
            bool     blnThereIsAProblem = false;
            DateTime datTransactionDate = DateTime.Now;
            int      intBulkToolID;

            try
            {
                if (cboSelectEmployee.SelectedIndex <= 0)
                {
                    blnFatalError    = true;
                    strErrorMessage += "Employee Was Not Selected\n";
                }
                if (cboSelectCategory.SelectedIndex <= 0)
                {
                    blnFatalError    = true;
                    strErrorMessage += "Tool Category Was Not Selected\n";
                }
                strValueForValidation = txtQuantity.Text;
                blnThereIsAProblem    = TheDataValidationClass.VerifyIntegerData(strValueForValidation);
                if (blnThereIsAProblem == true)
                {
                    blnFatalError    = true;
                    strErrorMessage += "The Quantity Entered is not an Integer\n";
                }
                else
                {
                    intQuantity = Convert.ToInt32(strValueForValidation);
                }
                strIssueNotes = txtIssueNotes.Text;
                if (strIssueNotes == "")
                {
                    blnFatalError    = true;
                    strErrorMessage += "No Notes Were Entered\n";
                }
                if (blnFatalError == true)
                {
                    TheMessagesClass.ErrorMessage(strErrorMessage);
                    return;
                }

                blnFatalError = TheBulkToolsClass.InsertBulkTools(MainWindow.gintEmployeeID, MainWindow.gintCategoryID, intQuantity, datTransactionDate, gintWarehouseEmployeeID, strIssueNotes);

                if (blnFatalError == true)
                {
                    throw new Exception();
                }

                TheFindBulkToolByDateMatchDataSet = TheBulkToolsClass.FindBulkToolsByDateMatch(datTransactionDate);

                intBulkToolID = TheFindBulkToolByDateMatchDataSet.FindBulkToolsByDateMatch[0].TransactionID;

                blnFatalError = TheBulkToolHistoryClass.InsertBulkToolHistory(MainWindow.gintEmployeeID, gintWarehouseEmployeeID, intQuantity, intBulkToolID, strIssueNotes);

                if (blnFatalError == true)
                {
                    throw new Exception();
                }

                TheMessagesClass.InformationMessage("Tools Are Signed Out");

                ResetControls();
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // Bulk Tool Sign Out // Sign Out Bulk Tool Menu Item " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }
        }