示例#1
0
        public DataTable DT_getvalueDebit(int FinancialAccountDimId, int YearDimId)
        {
            try
            {
                DataTable dt        = DT_header();
                DataTable dt_xp_all = DT_xp_ALL(FinancialAccountDimId, YearDimId, true, true, true, false);

                if (dt_xp_all == null || dt == null)
                {
                    return(null);
                }
                foreach (DataColumn dc_all in dt_xp_all.Columns)
                {
                    DataRow dr = dt.NewRow();

                    CorrespondFinancialAccountDim     Corr = BO.get_CorrespondFinancialAccountDim_1(session, int.Parse(dc_all.ColumnName), Utility.Constant.ROWSTATUS_ACTIVE);
                    FinancialGeneralLedgerByYear_Fact FGLY = BO.get_FinancialGeneralLedgerByYear_Fact_1(session, FinancialAccountDimId, YearDimId, Utility.Constant.ROWSTATUS_ACTIVE);

                    #region
                    if (Corr != null)
                    {
                        foreach (DataColumn dc in dt.Columns)
                        {
                            if (dc.ColumnName.Equals("TK"))
                            {
                                dr[dc.ColumnName] = Corr.Code;
                            }
                            if (!dc.ColumnName.Equals("TK"))
                            {
                                for (int i = 1; i <= 12; i++)
                                {
                                    if (FGLY != null && dc.ColumnName.Equals(i.ToString()))
                                    {
                                        FinancialGeneralLedgerByMonth FGLM = BO.get_FinancialGeneralLedgerByMonth_Debit(session, FGLY.FinancialGeneralLedgerByYear_FactId, int.Parse(dc_all.ColumnName), i, Utility.Constant.ROWSTATUS_ACTIVE);
                                        MonthDim MD = BO.get_MonthDimId(session, i.ToString(), Utility.Constant.ROWSTATUS_ACTIVE);
                                        if (FGLM != null && MD != null)
                                        {
                                            if (FGLM.DebitSum > 0)
                                            {
                                                dr[dc.ColumnName] = sumAcc(FGLM.CorrespondFinancialAccountDimId.Code, FGLM.FinancialGeneralLedgerByYear_FactId.FinancialGeneralLedgerByYear_FactId, MD.MonthDimId, false);
                                            }
                                            else
                                            {
                                                dr[dc.ColumnName] = 0;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        dt.Rows.Add(dr);
                    }
                    #endregion
                }

                return(dt);
            }
            catch (Exception) { return(null); }
        }
示例#2
0
 public FinancialGeneralLedgerByYear_Fact get_FinancialGeneralLedgerByYear_Fact(Session session, int FinancialGeneralLedgerByYear_FactId, short RowStatus)
 {
     try
     {
         FinancialGeneralLedgerByYear_Fact FGLY = session.FindObject <FinancialGeneralLedgerByYear_Fact>(
             CriteriaOperator.And(
                 new BinaryOperator("FinancialGeneralLedgerByYear_FactId", FinancialGeneralLedgerByYear_FactId, BinaryOperatorType.Equal),
                 new BinaryOperator("RowStatus", RowStatus, BinaryOperatorType.Equal)
                 ));
         if (FGLY == null)
         {
             return(null);
         }
         return(FGLY);
     }
     catch (Exception) { throw; }
 }
示例#3
0
        public void LoadData()
        {
            WebModule.Accounting.Report.GeneralLedger generalLedger = new WebModule.Accounting.Report.GeneralLedger();
            try
            {
                #region Parametter
                string account = this.GeneralLedgerAcc.Get("account_id").ToString();
                int    month   = int.Parse(this.GeneralLedgerMonth.Get("month_id").ToString());
                int    year    = int.Parse(this.GeneralLedgerYear.Get("year_id").ToString());
                string asset   = "VND"; //chua su dung gia tri nay neu co
                #endregion

                #region get value
                FinancialAccountDim FAD = BO.get_FinancialAccountDim(session, account, Utility.Constant.ROWSTATUS_ACTIVE);

                MonthDim MD = BO.get_MonthDimId(session, month.ToString(), Utility.Constant.ROWSTATUS_ACTIVE);

                YearDim YD = BO.get_YearDimId(session, year.ToString(), Utility.Constant.ROWSTATUS_ACTIVE);

                if (FAD != null && YD != null)
                {
                    FinancialGeneralLedgerByYear_Fact fgly = BO.get_FinancialGeneralLedgerByYear_Fact_1(session, FAD.FinancialAccountDimId, YD.YearDimId, Utility.Constant.ROWSTATUS_ACTIVE);
                    if (fgly != null)
                    {
                        #endregion

                        #region gan label
                        generalLedger.lblYear.Text     = year.ToString();
                        generalLedger.lbl_Account.Text = account;
                        if (fgly.BeginDebitBalance > 0)
                        {
                            generalLedger.lbl_beginDebit.Text = fgly.BeginDebitBalance.ToString("#,#");
                        }
                        else
                        {
                            generalLedger.lbl_beginDebit.Text = "0";
                        }
                        if (fgly.BeginCreditBalance > 0)
                        {
                            generalLedger.lbl_beginCredit.Text = fgly.BeginCreditBalance.ToString("#,#");
                        }
                        else
                        {
                            generalLedger.lbl_beginCredit.Text = "0";
                        }
                        #endregion

                        #region GridView_header va DT_header
                        GridView_header(FAD.FinancialAccountDimId);
                        DataTable dt = DT_header();
                        #endregion

                        #region do du lieu vao DataTable
                        DT_RowGetValue(dt, FAD.FinancialAccountDimId, YD.YearDimId, fgly.BeginCreditBalance, fgly.BeginDebitBalance);

                        #endregion

                        #region Bindata vao Gridview
                        xGridView.DataSource = dt;
                        xGridView.DataBind();
                        #endregion
                    }
                }
            }
            catch { }

            #region xuat report
            ASPxGridViewExporter1.GridViewID             = "xGridView";
            generalLedger.printableCC.PrintableComponent = new PrintableComponentLinkBase()
            {
                Component = ASPxGridViewExporter1
            };
            ReportViewerGLedger.Report = generalLedger;
            #endregion
        }