public DataTable GetShareInfo(ShareListBO shareBo)
        {
            string    queryString = "";
            DataTable dataTable   = new DataTable();

            queryString = @"RptGetShareInfo";
            try
            {
                _dbConnection.ConnectDatabase();
                _dbConnection.ActiveStoredProcedure();
                _dbConnection.AddParameter("@fromDate", SqlDbType.DateTime, shareBo.DtFrom.ToShortDateString());
                _dbConnection.AddParameter("@toDate", SqlDbType.DateTime, shareBo.DtTo.ToShortDateString());
                _dbConnection.AddParameter("@userID", SqlDbType.NVarChar, shareBo.WorkStation);
                dataTable = _dbConnection.ExecuteProQuery(queryString);
            }
            catch (Exception exception)
            {
                throw exception;
            }
            finally
            {
                _dbConnection.CloseDatabase();
            }
            return(dataTable);
        }
Пример #2
0
        private void LoadReport()
        {
            ShareListBAL shareBal            = new ShareListBAL();
            DataTable    dtParticipatoryInfo = new DataTable();

            dtParticipatoryInfo = shareBal.GetParticipatoryInfo();

            ShareListBO shareListBo = new ShareListBO();

            shareListBo.DtTo        = dtTo;
            shareListBo.DtFrom      = dtFrom;
            shareListBo.WorkStation = workStation;
            DataTable dataTable = new DataTable();



            RecordLevelFilteringBAL recordLevelFilteringBAL = new RecordLevelFilteringBAL();
            string TempWorkstation = "";

            int resourceId = recordLevelFilteringBAL.GetResourceID(ResourceName.Workstation_wise_Trade_Share_List);
            int criteriaId = recordLevelFilteringBAL.GetCriteriaID(resourceId);

            if (workStation == "All")
            {
                TempWorkstation = recordLevelFilteringBAL.FilterWorkStation_All(workStation, resourceId, criteriaId);
                if (TempWorkstation == "All")
                {
                    dataTable = shareBal.GetShareInfo(shareListBo);
                }

                else
                {
                    dataTable = shareBal.GetShareInfo(shareListBo);
                    dataTable.Rows.Clear();
                }
            }
            else
            {
                dataTable = shareBal.GetShareInfo(shareListBo);

                TempWorkstation = recordLevelFilteringBAL.FilterWorkStation(workStation, resourceId, criteriaId);
                if (TempWorkstation == "")
                {
                    dataTable.Rows.Clear();
                }
            }

            crShareReport crShareListReport = new crShareReport();

            ((TextObject)crShareListReport.ReportDefinition.ReportObjects["txtCompanyName"]).Text = dtParticipatoryInfo.Rows[0]["Name"].ToString();
            ((TextObject)crShareListReport.ReportDefinition.ReportObjects["txtBranchName"]).Text  = dtParticipatoryInfo.Rows[0]["Branch_Name"].ToString() + " Branch" + dtParticipatoryInfo.Rows[0]["Address"].ToString();
            if (shareListBo.DtFrom != null && shareListBo.DtTo != null)
            {
                ((TextObject)crShareListReport.ReportDefinition.Sections[2].ReportObjects["txtReportDuration"]).Text = "From " + shareListBo.DtFrom.ToShortDateString() + " To " + shareListBo.DtTo.ToShortDateString();
            }

            crShareListReport.SetDataSource(dataTable);
            CrvShareList.ReportSource = crShareListReport;
        }