Exemplo n.º 1
0
        public IList <ReportB01CII01Model> GetReportB01CII01(XtraForm frmParent, GlobalVariable commonVariable, ReportSharpHelper oRsTool)
        {
            IList <ReportB01CII01Model> list = null;

            if (!oRsTool.IsRefresh)
            {
                using (var frmParam = new FrmB01CII())
                {
                    frmParam.Text = @"Báo cáo quyết toán phần II";
                    if (frmParam.ShowDialog() == DialogResult.OK)
                    {
                        string FromDate = DateTime.Parse(frmParam.FromDate).ToShortDateString();
                        string ToDate   = DateTime.Parse(frmParam.ToDate).ToShortDateString();

                        if (!oRsTool.Parameters.ContainsKey("FromDate"))
                        {
                            oRsTool.Parameters.Add("FromDate", frmParam.FromDate);
                        }
                        if (!oRsTool.Parameters.ContainsKey("ToDate"))
                        {
                            oRsTool.Parameters.Add("ToDate", frmParam.ToDate);
                        }
                        if (!oRsTool.Parameters.ContainsKey("ReportDate"))
                        {
                            oRsTool.Parameters.Add("ReportDate", _globalVariable.PostedDate);
                        }

                        list = Model.GetB01CII01WithStoreProdure(commonVariable.ReportList.ProcedureName, FromDate, ToDate);
                    }
                }
            }
            return(list);
        }
Exemplo n.º 2
0
        public IList <ReportB01CIIModel> GetReportB01CII(XtraForm frmParent, GlobalVariable commonVariable, ReportSharpHelper oRsTool)
        {
            IList <ReportB01CIIModel> lstResult = null;

            if (!oRsTool.IsRefresh)
            {
                using (var frmParam = new FrmB01CII())
                {
                    frmParam.Text = @"Báo cáo quyết toán phần II";
                    if (frmParam.ShowDialog() == DialogResult.OK)
                    {
                        string FromDate = DateTime.Parse(frmParam.FromDate).ToShortDateString();
                        string ToDate   = DateTime.Parse(frmParam.ToDate).ToShortDateString();

                        lstResult = Model.GetB01CIIWithStoreProdure(commonVariable.ReportList.ProcedureName, FromDate, ToDate);
                        if (lstResult != null)
                        {
                            decimal defaultExchange = 1;
                            if (!oRsTool.Parameters.ContainsKey("PostedDate"))
                            {
                                oRsTool.Parameters.Add("PostedDate", Convert.ToDateTime(_globalVariable.PostedDate).ToString("dd/MM/yyyy"));
                            }
                            if (!oRsTool.Parameters.ContainsKey("FromDate"))
                            {
                                oRsTool.Parameters.Add("FromDate", frmParam.FromDate);
                            }
                            if (!oRsTool.Parameters.ContainsKey("ToDate"))
                            {
                                oRsTool.Parameters.Add("ToDate", frmParam.ToDate);
                            }
                            if (!oRsTool.Parameters.ContainsKey("ReportDate"))
                            {
                                oRsTool.Parameters.Add("ReportDate", _globalVariable.PostedDate);
                            }
                            if (!oRsTool.Parameters.ContainsKey("PeriodName"))
                            {
                                oRsTool.Parameters.Add("PeriodName", frmParam.PeriodName);
                            }
                            if (!oRsTool.Parameters.ContainsKey("ExchangeRateLastYear"))
                            {
                                oRsTool.Parameters.Add("ExchangeRateLastYear", lstResult.FirstOrDefault().ExchangeRateLastYear == defaultExchange ? 0 : lstResult.FirstOrDefault().ExchangeRateLastYear);
                            }
                            if (!oRsTool.Parameters.ContainsKey("ExchangeRateThisYear"))
                            {
                                oRsTool.Parameters.Add("ExchangeRateThisYear", lstResult.FirstOrDefault().ExchangeRateThisYear == defaultExchange ? 0 : lstResult.FirstOrDefault().ExchangeRateThisYear);
                            }
                        }
                    }
                }
            }
            return(lstResult);
        }