Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int reqID = Convert.ToInt32(Request.QueryString["r"]);
                int s     = Convert.ToInt32(Request.QueryString["s"]);
                CheckOutStatusEnum.FareghReqStatus status = new CheckOutStatusEnum.FareghReqStatus();
                status = (CheckOutStatusEnum.FareghReqStatus)s;
                string stcode = business.GetCheckOutStudentIDByReqID(reqID);
                this.StiWebViewer1.ResetReport();
                StiWebViewer1.Visible = true;
                StiReport rpt = new StiReport();
                rpt.Load(Server.MapPath("../Reports/CheckOutLoanAmount.mrt"));
                rpt.ReportCacheMode = StiReportCacheMode.On;
                rpt.Dictionary.Databases.Clear();
                rpt.Dictionary.Databases.Add(new StiSqlDatabase("Connection1", CB.ReportConnection.ToString()));
                rpt.Compile();
                rpt.CompiledReport.DataSources["[Request].[SP_GetStudentInfoForCheckOut]"].Parameters["@stdcode"].ParameterValue = stcode;
                rpt.CompiledReport.DataSources["[Request].[SP_Get_StudentLoanInfo]"].Parameters["@stcode"].ParameterValue        = stcode;

                DataTable dtResault = new DataTable();
                rpt.RegData(dtResault);
                StiWebViewer1.Report  = rpt;
                StiWebViewer1.Visible = true;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }
            var reqId  = Convert.ToInt32(Request.QueryString["r"]);
            var stcode = _business.GetCheckOutStudentIDByReqID(reqId);
            var report = new StiReport();

            report.Load(Server.MapPath("../Reports/CheckOutBankInfo.mrt"));
            report.Dictionary.Databases.Clear();
            report.Dictionary.Databases.AddRange(new StiDatabase[2] {
                new StiSqlDatabase("Connection1", CB.ReportConnection.ToString()), new StiSqlDatabase("Connection2", CB.ReportConnection.ToString())
            });
            report.Dictionary.Variables["StCode"].Value = stcode;
            StiWebViewer1.ResetReport();
            StiWebViewer1.Report  = report;
            StiWebViewer1.Visible = true;

            // int reqID = Convert.ToInt32(Request.QueryString["r"]);
            // int s = Convert.ToInt32(Request.QueryString["s"]);
            // CheckOutStatusEnum.FareghReqStatus status = new CheckOutStatusEnum.FareghReqStatus();
            // status = (CheckOutStatusEnum.FareghReqStatus)s;
            // string stcode = business.GetCheckOutStudentIDByReqID(reqID);
            // this.StiWebViewer1.ResetReport();
            // StiWebViewer1.Visible = true;
            // StiReport rpt = new StiReport();
            // rpt.Load(Server.MapPath("../Reports/CheckOutBankInfo.mrt"));
            // rpt.ReportCacheMode = StiReportCacheMode.On;
            // rpt.Dictionary.Databases.Clear();
            //// rpt.Dictionary.Databases.Add(new StiSqlDatabase("Connection1", dao.ReportConnection.ToString()));
            // rpt.Dictionary.Databases.Add(new StiSqlDatabase("Connection1", "Data Source=192.168.1.21;Initial Catalog=Supplementary_test;Password=t123*t456;User ID=teamuser"));
            // rpt.Compile();
            // rpt.CompiledReport.DataSources["[Request].[SP_GetBankAcountInfoCheckOut]"].Parameters["@stcode"].ParameterValue = 99900999;
            // //rpt.CompiledReport.DataSources["[Request].[SP_GetStudentInfoByStCode]"].Parameters["@stcode"].ParameterValue = 99900999;
            // DataTable dtResault = new DataTable();
            // rpt.RegData(dtResault);
            // StiWebViewer1.Report = rpt;
            // StiWebViewer1.Visible = true;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int       reqID   = Convert.ToInt32(Request.QueryString["r"]);
                DataTable request = business.GetCheckOutInfoByReqId(reqID);
                int       s       = Convert.ToInt32(request.Rows[0]["RequestLogId"]);
                issuerID = business.GetCheckOutStudentIDByReqID(reqID);

                CheckOutStatusEnum.FareghReqStatus status = new CheckOutStatusEnum.FareghReqStatus();
                status    = (CheckOutStatusEnum.FareghReqStatus)s;
                _signList = business.GetAllSigns();
                //string stcode = business.GetCheckOutStudentIDByReqID(reqID);
                this.StiWebViewer1.ResetReport();
                StiWebViewer1.Visible = true;
                StiReport rpt = new StiReport();
                rpt.Load(Server.MapPath("../Reports/CheckOutPrint2.mrt"));
                rpt.ReportCacheMode = StiReportCacheMode.On;
                rpt.Dictionary.Databases.Clear();
                rpt.Dictionary.Databases.Add(new StiSqlDatabase("Connection1", CB.ReportConnection.ToString()));


                if (status >= CheckOutStatusEnum.FareghReqStatus.amoozesh_ok)
                {
                    StiImage amoozesh = rpt.GetComponents()["Table1_Cell10"] as StiImage;
                    amoozesh.Image = byteArrayToImage((int)CheckOutStatusEnum.FareghReqStatus.amoozesh_ok, reqID);
                }
                if (status >= CheckOutStatusEnum.FareghReqStatus.daneshjooyi_ok)
                {
                    StiImage daneshjooyi = rpt.GetComponents()["Table1_Cell16"] as StiImage;
                    daneshjooyi.Image = byteArrayToImage((int)CheckOutStatusEnum.FareghReqStatus.daneshjooyi_ok, reqID);
                }
                if (status >= CheckOutStatusEnum.FareghReqStatus.pajohesh_ok)
                {
                    StiImage pajoohesh = rpt.GetComponents()["Table1_Cell22"] as StiImage;
                    pajoohesh.Image = byteArrayToImage((int)CheckOutStatusEnum.FareghReqStatus.pajohesh_ok, reqID);
                }
                if (status >= CheckOutStatusEnum.FareghReqStatus.refah_ok)
                {
                    StiImage refah = rpt.GetComponents()["Table1_Cell28"] as StiImage;
                    refah.Image = byteArrayToImage((int)CheckOutStatusEnum.FareghReqStatus.refah_ok, reqID);
                }
                if (status >= CheckOutStatusEnum.FareghReqStatus.maali_ok)
                {
                    StiImage maali = rpt.GetComponents()["Table1_Cell7"] as StiImage;
                    maali.Image = byteArrayToImage((int)CheckOutStatusEnum.FareghReqStatus.maali_ok, reqID);
                }

                if (status >= CheckOutStatusEnum.FareghReqStatus.mashmulan_ok)
                {
                    StiImage mashmoolan = rpt.GetComponents()["Table1_Cell19"] as StiImage;
                    bool     isMale     = business.isMale(issuerID);
                    if (isMale)
                    {
                        bool ismashmool = isMashmool(issuerID);
                        if (ismashmool)
                        {
                            bool bayganiOk = Convert.ToBoolean(request.Rows[0]["BayganiOk"]);
                            if (bayganiOk)
                            {
                                mashmoolan.Image = byteArrayToImage((int)CheckOutStatusEnum.FareghReqStatus.mashmulan_ok, reqID);
                            }
                            else
                            {
                                mashmoolan.Image = GetImageFromFile(imagetype.mashmool);
                            }
                        }
                        else
                        {
                            mashmoolan.Image = byteArrayToImage((int)CheckOutStatusEnum.FareghReqStatus.mashmulan_ok, reqID);
                        }
                    }
                    else
                    {
                        mashmoolan.Image = GetImageFromFile(imagetype.woman);
                    }
                }

                if (status >= CheckOutStatusEnum.FareghReqStatus.fani_ok)
                {
                    StiImage fani = rpt.GetComponents()["Table1_Cell13"] as StiImage;
                    fani.Image = byteArrayToImage((int)CheckOutStatusEnum.FareghReqStatus.fani_ok, reqID);
                }
                if (status >= CheckOutStatusEnum.FareghReqStatus.archive_ok)
                {
                    DataTable dtUserID = new DataTable();
                    dtUserID = business.getArchiveUserSignByStudentStcode(issuerID);
                    decimal userID = 0;
                    if (dtUserID.Rows[0]["userID"] != DBNull.Value)
                    {
                        userID = Convert.ToDecimal(dtUserID.Rows[0]["userID"]);
                    }

                    StiImage archive = rpt.GetComponents()["Table1_Cell25"] as StiImage;
                    archive.Image = byteArrayToImageArchive((int)CheckOutStatusEnum.FareghReqStatus.archive_ok, userID, reqID);
                }

                rpt.Compile();
                rpt.CompiledReport.DataSources["[Request].[SP_GetStudentInfoForCheckOut2]"].Parameters["@stdcode"].ParameterValue = issuerID;
                rpt.CompiledReport.DataSources["[Request].[SP_Get_StudentLoanInfo]"].Parameters["@stcode"].ParameterValue         = issuerID;
                //DataTable dtResault = new DataTable();
                //rpt.RegData(dtResault);
                StiWebViewer1.Report  = rpt;
                StiWebViewer1.Visible = true;
            }
        }