Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                hMailServerNetRemote.IApplication app = RemoteActivation.GetAuthenticatedRemotehMailServerApplication();
                if (app == null)
                {
                    Response.End();
                }

                hMailServerNetRemote.IDomain dom = app.Domains.ItemByDBID(Convert.ToInt32(Request.QueryString["ID"]));

                DomainName.Text = dom.Name;

                List <hMailServerNetRemote.IAccount> accounts = new List <hMailServerNetRemote.IAccount>();
                hMailServerNetRemote.IAccounts       accs     = dom.Accounts;
                int c = accs.Count;

                for (int i = 0; i < c; i++)
                {
                    accounts.Add(accs[i]);
                }

                AccountList.DataSource = accounts;
                AccountList.DataBind();
            }
        }
Ejemplo n.º 2
0
    private void LoadSubjects()
    {
        DataAbstract DA         = new DataAbstract();
        DataTable    categories = DA.returnCategories(userID).Tables[0];
        DataTable    accounts   = DA.returnAccounts(userID).Tables[0];

        //Set sources for the dropdowns and associate the text and value
        //   based on the datatable fields

        CategorySelect.DataSource     = categories;
        CategorySelect.DataTextField  = "Name";
        CategorySelect.DataValueField = "CategoryID";
        CategorySelect.DataBind();


        AccountList.DataSource     = accounts;
        AccountList.DataTextField  = "AcctNumber";
        AccountList.DataValueField = "AcctNumber";
        AccountList.DataBind();

        CategorySelect.Items.Insert(0, new ListItem("Select Category", "0"));
        AccountList.Items.Insert(0, new ListItem("Select Account", "0"));
    }
Ejemplo n.º 3
0
        protected void AccountList_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            try
            {
                XPQuery <Account> accountQuery = session.Query <Account>();
                Account           account      = (from c in accountQuery
                                                  where c.Code == e.OldValues["Code"]
                                                  select c).FirstOrDefault();
                AccountingBO accountBO = new AccountingBO();
                double       _Balance  = Double.Parse(e.NewValues["Balance"].ToString());

                AccountingPeriod _accountingPeriod = session.GetObjectByKey <AccountingPeriod>(Guid.Parse(cboAccountPeriod.Value.ToString()));

                if (_accountingPeriod == null)
                {
                    throw new Exception("Chưa chọn kỳ kế toán !");
                }

                AccountingPeriod accountPeriod = _accountingPeriod;

                accountBO.UpdateBalanceForwardTransaction(session, account.AccountId, _Balance);
                ASPxGridView grid = (ASPxGridView)sender;
                grid.CancelEdit();
                List <NAS.BO.Accounting.AccountingBO.AccountingEntity> rs = accountBO.getInitBalanceForward(session, _accountingPeriod);
                AccountList.DataSource = rs;
                AccountList.DataBind();
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                e.Cancel = true;
            }
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AccountingBO accountBO = new AccountingBO();

            //try
            //{
            //    accountBO.InitBalanceForward(session, AccountingPeriodBO.getCurrentAccountingPeriod(session));

            //    lbAccountingPeriod.Text = AccountingPeriodBO.getCurrentAccountingPeriod(session).Code;
            //    lbAccountingPeriodStartdate.Text = AccountingPeriodBO.getCurrentAccountingPeriod(session).FromDateTime.ToShortDateString();
            //    lbAccountingPeriodEnddate.Text = AccountingPeriodBO.getCurrentAccountingPeriod(session).ToDateTime.Date.ToShortDateString();
            //}
            //catch
            //{
            //    cpMessageBox.JSProperties.Clear();
            //    MessageBox1.Message.Text = String.Format("Chưa tạo chu kỳ tháng {0} năm {1}", DateTime.Now.Month, DateTime.Now.Year);
            //    cpMessageBox.JSProperties.Add("cpWarning", "Chưa tạo chu kỳ tháng " + DateTime.Now.Month.ToString());
            //}

            List <NAS.BO.Accounting.AccountingBO.AccountingEntity> rs = accountBO.getInitBalanceForward(session, AccountingPeriodBO.getCurrentAccountingPeriod(session));

            AccountList.DataSource = rs;
            AccountList.DataBind();
            AccountList.Focus();

            NAS.DAL.Accounting.Currency.Currency currency;

            if (cboBalanceInitCurrency.Value == null)
            {
                CriteriaOperator _filter = new GroupOperator(GroupOperatorType.And,
                                                             new BinaryOperator("IsDefault", 1, BinaryOperatorType.Equal),
                                                             new BinaryOperator("CurrencyTypeId.IsMaster", 1, BinaryOperatorType.Equal));
                currency = session.FindObject <NAS.DAL.Accounting.Currency.Currency>(_filter);
                if (currency != null)
                {
                    cboBalanceInitCurrency.Value = currency.CurrencyId;
                }
            }

            currency = session.GetObjectByKey <NAS.DAL.Accounting.Currency.Currency>(Guid.Parse(cboBalanceInitCurrency.Value.ToString()));
            if (currency != null)
            {
                int    i  = 0;
                string _p = GetDecimals(currency.Coefficient, i).ToString();

                if (Int32.Parse(_p) <= 0)
                {
                    m_FormatNumber = m_FormatNumber.Replace('6', '0');
                }
                else
                {
                    m_FormatNumber = m_FormatNumber.Replace('6', char.Parse(_p));
                }
            }


            BalanceLineSetData();
            tgrdAccountBalance.ExpandToLevel(1);

            (tgrdAccountBalance.Columns["Debit"] as TreeListDataColumn).PropertiesEdit.DisplayFormatString  = m_FormatNumber;
            (tgrdAccountBalance.Columns["Credit"] as TreeListDataColumn).PropertiesEdit.DisplayFormatString = m_FormatNumber;

            if (!Page.IsPostBack)
            {
                refreshSummaryFooter();
            }
        }