Ejemplo n.º 1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            RptSummaryofMonthlyInvPerBrand rpt = new RptSummaryofMonthlyInvPerBrand();

            rpt.Site = this.Site;
            return(rpt);
        }
        private void Acc_SummaryofStoreInventoryAndSummaryofMonthlyInvPerBrand()
        {
            ReportDocument rpt;
            string rptDocCachedKey = null;

            SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["IRMSConnectionString"].ConnectionString);

            conn.Open();

            SqlCommand cmd = new SqlCommand();

            if (Request.QueryString["rptnameSOI"] == "rptSummMonthlyInvPerBrand")
            {
                rptDocCachedKey = "rptSummMonthlyInvPerBrand";
                if (Cache[rptDocCachedKey] != null)
                {
                    rpt = (RptSummaryofMonthlyInvPerBrand)Cache[rptDocCachedKey];
                }
                else
                {
                    rpt = new RptSummaryofMonthlyInvPerBrand();
                    Cache.Insert(rptDocCachedKey, rpt);
                }
                if (Request.QueryString["customertype"] == "PROVINCIAL")
                {
                    cmd.Connection = conn;
                    cmd.CommandTimeout = 3000;
                    cmd.CommandText = "GenRptSummaryofMonthlyInvPerBrandProv '" + Request.QueryString["datefrom"] + "','" + Request.QueryString["dateto"] + "','" + Request.QueryString["brand"] + "', '" + Session["USER_NAME"] + "'";
                    cmd.ExecuteNonQuery();
                }
                else if (Request.QueryString["customertype"] == "DEPT. STORE")
                {
                    cmd.Connection = conn;
                    cmd.CommandTimeout = 3000;
                    cmd.CommandText = "GenRptSummaryofMonthlyInvPerBrandDept '" + Request.QueryString["datefrom"] + "','" + Request.QueryString["dateto"] + "','" + Request.QueryString["brand"] + "', '" + Session["USER_NAME"] + "'";
                    cmd.ExecuteNonQuery();
                }
                else
                {
                    cmd.Connection = conn;
                    cmd.CommandTimeout = 3000;
                    cmd.CommandText = "GenRptSummaryofMonthlyInvPerBrandBoutique '" + Request.QueryString["datefrom"] + "','" + Request.QueryString["dateto"] + "','" + Request.QueryString["brand"] + "', '" + Session["USER_NAME"] + "'";
                    cmd.ExecuteNonQuery();
                }
            }
            else
            {
                rptDocCachedKey = "RptSummStoreInventory";
                if (Cache[rptDocCachedKey] != null)
                {
                    rpt = (RptSummStoreInventory)Cache[rptDocCachedKey];
                }
                else
                {
                    rpt = new RptSummStoreInventory();
                    Cache.Insert(rptDocCachedKey, rpt);
                }

                if (Request.QueryString["customertype"] == "PROVINCIAL")
                {
                    cmd.Connection = conn;
                    cmd.CommandTimeout = 3000;
                    cmd.CommandText = "GenRptStoreSummInvProv '" + Request.QueryString["datefrom"] + "','" + Request.QueryString["dateto"] + "','" + Request.QueryString["brand"] + "', '" + Session["USER_NAME"] + "'";
                    cmd.ExecuteNonQuery();
                }
                else if (Request.QueryString["customertype"] == "DEPT. STORE")
                {
                    cmd.Connection = conn;
                    cmd.CommandTimeout = 3000;
                    cmd.CommandText = "GenRptStoreSummInvDept '" + Request.QueryString["datefrom"] + "','" + Request.QueryString["dateto"] + "','" + Request.QueryString["brand"] + "', '" + Session["USER_NAME"] + "'";
                    cmd.ExecuteNonQuery();
                }
                else
                {
                    cmd.Connection = conn;
                    cmd.CommandTimeout = 3000;
                    cmd.CommandText = "GenRptStoreSummInvBoutique '" + Request.QueryString["datefrom"] + "','" + Request.QueryString["dateto"] + "','" + Request.QueryString["brand"] + "', '" + Session["USER_NAME"] + "'";
                    cmd.ExecuteNonQuery();
                }
            }

            DataBaseLogIn(rpt);

            ParameterField prmUserName = new ParameterField();
            ParameterField prmCustType = new ParameterField();
            ParameterField prmBrandName = new ParameterField();
            ParameterFields prmList = new ParameterFields();

            prmUserName.ParameterFieldName = "username";
            prmBrandName.ParameterFieldName = "brandname";
            prmCustType.ParameterFieldName = "custtype";

            ParameterDiscreteValue prmUserNameValue = new ParameterDiscreteValue();
            ParameterDiscreteValue prmBrandNameValue = new ParameterDiscreteValue();
            ParameterDiscreteValue prmCustTypeValue = new ParameterDiscreteValue();

            prmUserNameValue.Value = Session["USER_NAME"];
            prmBrandNameValue.Value = Request.QueryString["brand"];
            prmCustTypeValue.Value = Request.QueryString["customertype"];

            prmUserName.CurrentValues.Add(prmUserNameValue);
            prmBrandName.CurrentValues.Add(prmBrandNameValue);
            prmCustType.CurrentValues.Add(prmCustTypeValue);

            prmList.Add(prmUserName);
            prmList.Add(prmBrandName);
            prmList.Add(prmCustType);

            crvDailyReport.ParameterFieldInfo = prmList;
            crvDailyReport.ReportSource = rpt;
        }
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
 {
     RptSummaryofMonthlyInvPerBrand rpt = new RptSummaryofMonthlyInvPerBrand();
     rpt.Site = this.Site;
     return rpt;
 }