Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AccountingBO accountBO = new AccountingBO();
            //accountBO.InitBalanceForward(session, AccountingPeriodBO.getCurrentAccountingPeriod(session));
            var datasource1 = accountBO.getLedgerListByAccountCategory(session, "ASSET");
            var datasource2 = accountBO.getLedgerListByAccountCategory(session, "LIABILITY");
            var datasource3 = accountBO.getLedgerListByAccountCategory(session, "EQUITY");

            ASPxTreeList1.DataSource = datasource1;
            ASPxTreeList2.DataSource = datasource2;
            ASPxTreeList3.DataSource = datasource3;

            ASPxTreeList1.DataBind();
            ASPxTreeList2.DataBind();
            ASPxTreeList3.DataBind();
            XPQuery <AccountCategory> AccCateQuery = session.Query <AccountCategory>();
            General gen = new General();

            AccountCategory AccCate = AccCateQuery.Where(r => r.Code == "ASSET").FirstOrDefault();

            totalAsset = gen.TotalBalance(session, AccCate);

            AccCate        = AccCateQuery.Where(r => r.Code == "LIABILITY").FirstOrDefault();
            totalLiability = gen.TotalBalance(session, AccCate);

            AccCate     = AccCateQuery.Where(r => r.Code == "EQUITY").FirstOrDefault();
            totalEquity = gen.TotalBalance(session, AccCate);
            ASPxTextBox tb1 = ASPxTreeList1.FindFooterTemplateControl(ASPxTreeList1.Columns[2], "AssetTotal") as ASPxTextBox;

            tb1.Value = ParseStringNumber(totalAsset.ToString());
            tb1.Text  = ParseStringNumber(totalAsset.ToString());
            ASPxTextBox tb2 = ASPxTreeList2.FindFooterTemplateControl(ASPxTreeList2.Columns[2], "LiabilityTotal") as ASPxTextBox;

            tb2.Value = ParseStringNumber(totalLiability.ToString());
            tb2.Text  = ParseStringNumber(totalLiability.ToString());
            ASPxTextBox tb3 = ASPxTreeList3.FindFooterTemplateControl(ASPxTreeList3.Columns[2], "EquityTotal") as ASPxTextBox;

            tb3.Value = ParseStringNumber(totalEquity.ToString());
            tb3.Text  = ParseStringNumber(totalEquity.ToString());
            ASPxTextBox tb4 = ASPxTreeList3.FindFooterTemplateControl(ASPxTreeList3.Columns[2], "DebitTotal") as ASPxTextBox;

            tb4.Value = ParseStringNumber((totalLiability + totalEquity).ToString());
            tb4.Text  = ParseStringNumber((totalLiability + totalEquity).ToString());
        }
Пример #2
0
        private void fillAllStructure()
        {
            List <Employee_Structure> ListEmployeeStructure10 = new List <Employee_Structure>();

            ListEmployeeStructure10 = loadSendEmployeeStructure();
            if (SessionWrapper.LoggedUser.Language_id == 1)
            {
                var dc1 = from c in ListEmployeeStructure10
                          where c.Employee_Id != currentUserId
                          select new
                {
                    ddlKey       = c.Employee_Structure_Id,
                    employeeName = c.Employee.Employee_Name_Ar,
                    jobTitle     = c.Structure.Structure_Name_Ar
                };

                ASPxGridView1.DataSource = dc1.ToList();
                ASPxGridView1.DataBind();

                ASPxGridView2.DataSource = dc1.ToList();
                ASPxGridView2.DataBind();
            }
            else
            {
                var dc1 = from c in ListEmployeeStructure10
                          where c.Employee_Id != currentUserId
                          select new
                {
                    ddlKey       = c.Employee_Structure_Id,
                    employeeName = c.Employee.Employee_Name_En,
                    jobTitle     = c.Structure.Structure_Name_En
                };

                ASPxGridView1.DataSource = dc1.ToList();
                ASPxGridView1.DataBind();

                ASPxGridView2.DataSource = dc1.ToList();
                ASPxGridView2.DataBind();
            }
            ////////////////////////////////////////////////////////////////////////////////////////////////

            ListStructure                 = loadTreeStructure();
            ASPxTreeList1.DataSource      = ListStructure;
            ASPxTreeList1.KeyFieldName    = "Structure_Id";
            ASPxTreeList1.ParentFieldName = "Structure_Parent";
            if (SessionWrapper.LoggedUser.Language_id == 1)
            {
                ASPxTreeList1.PreviewFieldName = "Structure_Name_Ar";
            }
            else
            {
                ASPxTreeList1.PreviewFieldName = "Structure_Name_En";
            }
            ASPxTreeList1.DataBind();

            ASPxTreeList2.DataSource      = ListStructure;
            ASPxTreeList2.KeyFieldName    = "Structure_Id";
            ASPxTreeList2.ParentFieldName = "Structure_Parent";
            if (SessionWrapper.LoggedUser.Language_id == 1)
            {
                ASPxTreeList2.PreviewFieldName = "Structure_Name_Ar";
            }
            else
            {
                ASPxTreeList2.PreviewFieldName = "Structure_Name_En";
            }
            ASPxTreeList2.DataBind();
        }