Пример #1
0
        /// <summary>
        /// Lists the account names.
        /// </summary>
        /// <returns>The dataset containing the AccountNames.</returns>
        public static DepositHistoryData.ListAccountNameDataTable ListAccountNames()
        {
            DepositHistoryData depositHistoryData = new DepositHistoryData();
            Hashtable          ht = new Hashtable();

            Utility.LoadDataSet(depositHistoryData.ListAccountName, "f1213_pclst_AccountName", ht);
            return(depositHistoryData.ListAccountName);
        }
Пример #2
0
        /// <summary>
        /// Gets the PaymentItems Details
        /// </summary>
        /// <returns>The dataset containing the comments.</returns>
        public static DepositHistoryData ListDepositHistoryDetails()
        {
            DepositHistoryData depositHistoryData = new DepositHistoryData();
            Hashtable          ht = new Hashtable();

            string[] tableName = new string[] { depositHistoryData.ListDepositHistoryTable.TableName };
            Utility.LoadDataSet(depositHistoryData, "f1213_pclst_DepositHistory", ht, tableName);
            return(depositHistoryData);
        }
Пример #3
0
        /// <summary>
        /// Gets the deposit history search result.
        /// </summary>
        /// <param name="form">The form.</param>
        /// <param name="whereCondnSql">The where condn SQL.</param>
        /// <returns>DepositHistoryDataSet contains the resulted Search</returns>
        public static DepositHistoryData GetDepositHistorySearchResult(int form, string whereCondnSql)
        {
            DepositHistoryData depositHistoryData = new DepositHistoryData();
            Hashtable          ht = new Hashtable();

            ht.Add("@Form", form);
            ht.Add("@WhereCondnSql", whereCondnSql);
            Utility.LoadDataSet(depositHistoryData.ListDepositHistoryTable, "f1213_pcexe_DepositHistory", ht);
            return(depositHistoryData);
        }
Пример #4
0
        /// <summary>
        /// Loads the afiidavit list grid.
        /// </summary>
        private void LoadDepositHistoryGrid()
        {
            this.CustomizeDataGrid();
            this.depositHistoryDataSet = new DepositHistoryData();
            this.bindingSource         = new BindingSource();
            this.depositHistoryDataSet = this.form1213Controll.WorkItem.ListDepositHistoryDetails();
            this.RowCount = this.depositHistoryDataSet.ListDepositHistoryTable.Rows.Count;
            this.DepositHistoryDataGrid.DataSource = this.depositHistoryDataSet.ListDepositHistoryTable;
            this.bindingSource.DataSource          = this.depositHistoryDataSet.ListDepositHistoryTable.Copy();
            this.InitAccountNameCombo();
            this.InitIsClearedCombo();

            if (this.RowCount == 0)
            {
                this.emptyRecord                             = true;
                this.SearchButton.Enabled                    = false;
                this.DepositHistoryAuditLink.Enabled         = false;
                this.additionalOperationSmartPart.Enabled    = false;
                this.DepositHistoryDataGrid.Rows[0].Selected = false;
                this.DepositHistoryDataGrid.Enabled          = false;
            }
            else
            {
                this.emptyRecord = false;
                this.DepositHistoryAuditLink.Text = SharedFunctions.GetResourceString("1213DepositHistoryAuditLink") + " " + this.DepositHistoryDataGrid.Rows[0].Cells[this.depositHistoryDataSet.ListDepositHistoryTable.CLIDColumn.ToString()].Value.ToString();
                this.SetDataGridViewPosition(0);
                this.DepositHistoryAuditLink.Enabled      = true;
                this.additionalOperationSmartPart.Enabled = true;
                this.DepositHistoryDataGrid.Enabled       = true;
            }

            if (this.RowCount > this.DepositHistoryDataGrid.NumRowsVisible)
            {
                this.DepositHistoryVScrollBar.Enabled = true;
                this.DepositHistoryVScrollBar.Visible = false;
            }
            else
            {
                this.DepositHistoryVScrollBar.Enabled = false;
                this.DepositHistoryVScrollBar.Visible = true;
            }
        }
Пример #5
0
        /// <summary>
        /// Gets the where clause.
        /// </summary>
        private void GetWhereClause()
        {
            ////set reducedRecordSet
            this.reducedRecordSet            = true;
            this.searchDepositHistoryDataSet = new DepositHistoryData();
            this.searchBindingSource         = new BindingSource();
            string        returnValue         = String.Empty;
            StringBuilder whereClause         = new StringBuilder(String.Empty);
            bool          previousValueExists = false;
            bool          invalidQuery        = false;

            Control[] controlArray = new Control[] { this.SearchCLIDTextBox, this.SearchEntryDateTextBox, this.SearchRegisterIDTextBox, this.SearchUserTextBox, this.SearchIsClearedTextBox, this.SearchAmountTextBox };

            for (int i = 0; i < controlArray.Length; i++)
            {
                Control queryControl = controlArray.GetValue(i) as Control;

                if (!String.IsNullOrEmpty(queryControl.Text.Trim()))
                {
                    //// ParseSqlWhereCondition returns string containing parsed query value
                    if (!Convert.ToBoolean(string.Compare(queryControl.Name, this.SearchRegisterIDTextBox.Name)))
                    {
                        returnValue = SharedFunctions.FormatSqlWhereCondition(queryControl.Tag.ToString(), "'" + queryControl.Text.Trim().ToUpper() + "'", this.searchDepositHistoryDataSet.ListAccountName.Columns[queryControl.Tag.ToString()].DataType);
                    }
                    else if (!Convert.ToBoolean(string.Compare(queryControl.Name, this.SearchIsClearedTextBox.Name)))
                    {
                        returnValue = SharedFunctions.FormatSqlWhereCondition(queryControl.Tag.ToString(), "'" + queryControl.Text.Trim().ToUpper() + "'", this.searchDepositHistoryDataSet.ListDepositHistoryTable.Columns[queryControl.Tag.ToString()].DataType);
                    }
                    else
                    {
                        returnValue = SharedFunctions.FormatSqlWhereCondition(queryControl.Tag.ToString(), "'" + queryControl.Text.Trim().ToUpper() + "'", this.searchDepositHistoryDataSet.ListDepositHistoryTable.Columns[queryControl.Tag.ToString()].DataType);
                    }

                    if (!String.IsNullOrEmpty(returnValue))
                    {
                        if (previousValueExists)
                        {
                            whereClause.Append(" AND ");
                        }

                        previousValueExists = true;
                        whereClause.Append("(");
                        whereClause.Append(returnValue);
                        whereClause.Append(")");
                    }
                    else
                    {
                        invalidQuery = true;
                        break;
                    }
                }
            }

            try
            {
                int recordsCount = 0;
                if (invalidQuery)
                {
                    this.DepositHistoryDataGrid.DataSource = null;
                    this.searchDepositHistoryDataSet.ListDepositHistoryTable.Clear();
                    recordsCount = this.searchDepositHistoryDataSet.ListDepositHistoryTable.Rows.Count;
                }
                else
                {
                    this.searchDepositHistoryDataSet = this.form1213Controll.WorkItem.GetDepositHistorySearchResult(1213, whereClause.ToString());
                    recordsCount = this.searchDepositHistoryDataSet.ListDepositHistoryTable.Rows.Count;
                    this.DepositHistoryDataGrid.DataSource = this.searchDepositHistoryDataSet.ListDepositHistoryTable;
                    this.searchBindingSource.DataSource    = this.searchDepositHistoryDataSet.ListDepositHistoryTable.Copy();
                    this.SearchValue = true;
                }

                if (recordsCount > 0)
                {
                    this.emptyRecord = false;
                    this.DepositHistoryAuditLink.Enabled         = true;
                    this.DepositHistoryAuditLink.Text            = SharedFunctions.GetResourceString("1213DepositHistoryAuditLink") + " " + this.DepositHistoryDataGrid.Rows[0].Cells[this.depositHistoryDataSet.ListDepositHistoryTable.CLIDColumn.ToString()].Value.ToString();
                    this.DepositHistoryDataGrid.Enabled          = true;
                    this.DepositHistoryDataGrid.Rows[0].Selected = true;
                    this.DepositHistoryDataGrid.Focus();
                    this.additionalOperationSmartPart.Enabled = true;
                }
                else
                {
                    this.emptyRecord = true;
                    this.DepositHistoryDataGrid.CurrentCell      = null;
                    this.DepositHistoryAuditLink.Enabled         = false;
                    this.DepositHistoryDataGrid.Rows[0].Selected = false;
                    this.DepositHistoryDataGrid.Enabled          = false;
                    this.additionalOperationSmartPart.Enabled    = false;
                }

                if (this.searchDepositHistoryDataSet.ListDepositHistoryTable.Rows.Count > 20)
                {
                    this.DepositHistoryVScrollBar.Enabled = true;
                    this.DepositHistoryVScrollBar.Visible = false;
                }
                else
                {
                    this.DepositHistoryVScrollBar.Enabled = false;
                    this.DepositHistoryVScrollBar.Visible = true;
                }
            }
            catch (SoapException)
            {
                MessageBox.Show(SharedFunctions.GetResourceString("InvalidQuery") + SharedFunctions.GetResourceString("QueryModificationMessage"), ConfigurationWrapper.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }