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;
            }
        }