Exemplo n.º 1
0
        // load cmboGLFilter
        private void loadCmboGLFilter()
        {
            ArrayList arrNew    = new ArrayList();
            int       currentFY = UtilityDates.getCurrentFiscalYear();

            arrNew.Add(new ListValues("", "YTD", ListValues.FORWARD));
            arrNew.Add(new ListValues((int.Parse(cmboFY.SelectedValue.ToString()) + 1).ToString() + "01", "January", ListValues.FORWARD));
            arrNew.Add(new ListValues((int.Parse(cmboFY.SelectedValue.ToString()) + 1).ToString() + "02", "February", ListValues.FORWARD));
            arrNew.Add(new ListValues((int.Parse(cmboFY.SelectedValue.ToString()) + 1).ToString() + "03", "March", ListValues.FORWARD));
            arrNew.Add(new ListValues((int.Parse(cmboFY.SelectedValue.ToString()) + 1).ToString() + "04", "April", ListValues.FORWARD));
            arrNew.Add(new ListValues((int.Parse(cmboFY.SelectedValue.ToString()) + 1).ToString() + "05", "May", ListValues.FORWARD));
            arrNew.Add(new ListValues((int.Parse(cmboFY.SelectedValue.ToString()) + 1).ToString() + "06", "June", ListValues.FORWARD));
            arrNew.Add(new ListValues(cmboFY.SelectedValue.ToString() + "07", "July", ListValues.FORWARD));
            arrNew.Add(new ListValues(cmboFY.SelectedValue.ToString() + "08", "August", ListValues.FORWARD));
            arrNew.Add(new ListValues(cmboFY.SelectedValue.ToString() + "09", "September", ListValues.FORWARD));
            arrNew.Add(new ListValues(cmboFY.SelectedValue.ToString() + "10", "October", ListValues.FORWARD));
            arrNew.Add(new ListValues(cmboFY.SelectedValue.ToString() + "11", "Novermber", ListValues.FORWARD));
            arrNew.Add(new ListValues(cmboFY.SelectedValue.ToString() + "12", "December", ListValues.FORWARD));

            cmboGLFilter.DataSource    = arrNew;
            cmboGLFilter.DisplayMember = "Desc";
            cmboGLFilter.ValueMember   = "ID";
            cmboGLFilter.SelectedIndex = 0; // selects Fiscal year to date
            isCmboGLFilterLoaded       = true;
        }
Exemplo n.º 2
0
        //Load cmboFY

        private void loadCmboFY()
        {
            ArrayList arrNew = new ArrayList();

            //       arrNew.Add(new ListValues("", "ALL FYs", ListValues.FORWARD));

            for (int i = UtilityDates.getCurrentFiscalYear(); i >= 2008; i--)
            {
                arrNew.Add(new ListValues(i.ToString(), i.ToString(), ListValues.FORWARD));
            }

            cmboFY.DataSource    = arrNew;
            cmboFY.DisplayMember = "Desc";
            cmboFY.ValueMember   = "ID";
            cmboFY.SelectedIndex = 0; // selects current fy which is always the second item on the list
            isCmboFYLoaded       = true;
        }
Exemplo n.º 3
0
        private void buildDBConnector(bool isSearched)
        {
            this.Cursor = Cursors.WaitCursor;
            String whereSQL = "";

            if (isSearched)
            {
                whereSQL += " WHERE Transactions.TransID in (";
                for (int i = 0; i < arrTransIDs.Count; i++)
                {
                    whereSQL += arrTransIDs[i] + ",";
                }
                whereSQL  = whereSQL.TrimEnd(',');
                whereSQL += ")";
                Console.WriteLine("ccc  " + whereSQL);
            }
            else
            {
                if (lstTransTypes.SelectedValue != null)
                {
                    if (whereSQL.Contains("WHERE"))
                    {
                        whereSQL += " AND ";
                    }
                    else
                    {
                        whereSQL += " WHERE ";
                    }
                    whereSQL += " Transactions.refTransTypeID = " + lstTransTypes.SelectedValue.ToString();
                }

                if (lstStatus.SelectedValue != null)
                {
                    if (whereSQL.Contains("WHERE"))
                    {
                        whereSQL += " AND ";
                    }
                    else
                    {
                        whereSQL += " WHERE ";
                    }
                    whereSQL += " Transactions.TransStatusID = " + lstStatus.SelectedValue.ToString();
                }

                if (lstUnitID.SelectedValue != null)
                {
                    if (whereSQL.Contains("WHERE"))
                    {
                        whereSQL += " AND ";
                    }
                    else
                    {
                        whereSQL += " WHERE ";
                    }
                    whereSQL += " Transactions_Funding.UnitID = '" + lstUnitID.SelectedValue.ToString() + "' ";
                }

                if (lstTransGL.SelectedValue != null)
                {
                    if (whereSQL.Contains("WHERE"))
                    {
                        whereSQL += " AND ";
                    }
                    else
                    {
                        whereSQL += " WHERE ";
                    }
                    whereSQL += " Transactions.GLID = '" + lstTransGL.SelectedValue.ToString() + "' ";
                }
            }

            whereSQL += " AND Transactions.TransDatePosting >= CONVERT(DATETIME, '" + UtilityDates.getCurrentFiscalYear() + "-07-01 00:00:00', 102) AND Transactions.TransDatePosting < CONVERT(DATETIME, '" + (UtilityDates.getCurrentFiscalYear() + 1) + "-07-01 00:00:00', 102)";

            dbcTransactions = new DBConnector(baseSQL + whereSQL + sortSQL, "Transactions");
            Console.WriteLine(baseSQL + whereSQL + sortSQL);
            loadlstTransactions();
            this.Cursor = Cursors.Default;
        }