Esempio n. 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            databaseaccesslayer dataobj = new databaseaccesslayer();

            try
            {
                string    sql1 = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=38 and IsVaild=1";
                DataTable dt1  = dataobj.Selectdatatable(sql1);
                if (dt1.Rows.Count != 1)
                {
                    Response.Redirect("MainPage.aspx");
                }
                if (Request.QueryString["Id"] != null && Request.QueryString["Id"].ToString() != "")
                {
                    string         sql            = @"ReportBalanceEmployee " + Request.QueryString["Id"].ToString();
                    ReportDocument reportdocument = new ReportDocument();
                    reportdocument.Load(Server.MapPath("Reports/RepBalanceEmployees.rpt"));
                    reportdocument.DataSourceConnections[0].SetConnection(".", "Lawer", true);
                    reportdocument.SetDataSource(dataobj.Selectdatatable(sql));
                    reportdocument.SetParameterValue("@Id", int.Parse(Request.QueryString["Id"].ToString()));
                    CrystalReportViewer1.ReportSource = reportdocument;
                }
                else
                {
                    Response.Redirect("ReportDetailsIssue.aspx");
                }
            }
            catch (Exception)
            {
                Response.Redirect("MainPage.aspx");
            }
        }
    }
Esempio n. 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         databaseaccesslayer dataobj = new databaseaccesslayer();
         string    sql1 = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=28 and IsVaild=1";
         DataTable dt1  = dataobj.Selectdatatable(sql1);
         if (dt1.Rows.Count != 1)
         {
             Response.Redirect("MainPage.aspx");
         }
         if (Request.QueryString["Status"] != null && Request.QueryString["Status"].ToString() != "" && Session["DateFrom"] != null && Session["DateFrom"].ToString() != "" && Session["DateTo"] != null && Session["DateTo"].ToString() != "")
         {
             string         sql            = @"ReportTask " + Request.QueryString["Status"].ToString() + ",'" + Session["DateFrom"] + "','" + Session["DateTo"] + "'";
             ReportDocument reportdocument = new ReportDocument();
             reportdocument.Load(Server.MapPath("Reports/RepAllTask.rpt"));
             reportdocument.DataSourceConnections[0].SetConnection(".", "Lawer", true);
             reportdocument.SetDataSource(dataobj.Selectdatatable(sql));
             reportdocument.SetParameterValue("@Status", int.Parse(Request.QueryString["Status"].ToString()));
             reportdocument.SetParameterValue("@DateFrom", DateTime.Parse(Session["DateFrom"].ToString()).ToShortDateString());
             reportdocument.SetParameterValue("@DateTo", DateTime.Parse(Session["DateTo"].ToString()).ToShortDateString());
             CrystalReportViewer1.ReportSource = reportdocument;
         }
         else
         {
             Response.Redirect("MainPage.aspx");
         }
     }
 }
Esempio n. 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        databaseaccesslayer dataobj = new databaseaccesslayer();

        if (!IsPostBack)
        {
            try
            {
                string    sql1 = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=12 and IsVaild=1";
                DataTable dt1  = dataobj.Selectdatatable(sql1);
                if (dt1.Rows.Count != 1)
                {
                    Response.Redirect("MainPage.aspx");
                }
                string         sql            = @"ReportNotActiveIssue";
                ReportDocument reportdocument = new ReportDocument();
                reportdocument.Load(Server.MapPath("Reports/ReAllNotActiveIssue.rpt"));
                reportdocument.DataSourceConnections[0].SetConnection(".", "Lawer", true);
                reportdocument.SetDataSource(dataobj.Selectdatatable(sql));
                CrystalReportViewer1.ReportSource = reportdocument;
            }
            catch (Exception)
            {
                Response.Redirect("MainPage.aspx");
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        databaseaccesslayer dataobj = new databaseaccesslayer();

        if (!IsPostBack)
        {
            try
            {
                string    sql1 = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=56 and IsVaild=1";
                DataTable dt1  = dataobj.Selectdatatable(sql1);
                if (dt1.Rows.Count == 1)
                {
                    string sql  = @"select * from CustomerAndSupplier where Supplier=1";
                    string path = "Reports/ReportSupplier.rpt";
                    string sqls = sql;
                    System.Drawing.Printing.PrintDocument printDocument = new System.Drawing.Printing.PrintDocument();
                    ReportDocument reportdocument = new ReportDocument();
                    reportdocument.Load(Server.MapPath(path));
                    reportdocument.DataSourceConnections[0].SetConnection(".", "ERPsystem", true);
                    reportdocument.SetDataSource(dataobj.Selectdatatable(sqls));
                    reportdocument.SetParameterValue("@Type", true);
                    CrystalReportViewer1.ReportSource = reportdocument;
                }
                else
                {
                    Response.Redirect("MainPage.aspx");
                }
            }
            catch (Exception)
            {
                Response.Redirect("MainPage.aspx");
            }
        }
    }