Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Vd.isValidLogin();

            if (!IsPostBack)
            {
                hideMessageBox();
                clearAll(this.Form.Controls);
            }
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            bRes = false;

            Vd.isValidLogin();

            if (!IsPostBack)
            {
                try
                {
                    ReportDocument rprt     = new ReportDocument();
                    ConnectionInfo connInfo = new ConnectionInfo();
                    connInfo.ServerName   = "edo";
                    connInfo.DatabaseName = "png";
                    connInfo.UserID       = "sa";
                    connInfo.Password     = "******";

                    TableLogOnInfo tableLogOnInfo = new TableLogOnInfo();
                    tableLogOnInfo.ConnectionInfo = connInfo;

                    rprt.Load(Server.MapPath("~\\RptTemp\\rptPLNA4-4.rpt"));

                    foreach (CrystalDecisions.CrystalReports.Engine.Table table in rprt.Database.Tables)
                    {
                        table.ApplyLogOnInfo(tableLogOnInfo);
                        table.LogOnInfo.ConnectionInfo.ServerName   = connInfo.ServerName;
                        table.LogOnInfo.ConnectionInfo.DatabaseName = connInfo.DatabaseName;
                        table.LogOnInfo.ConnectionInfo.UserID       = connInfo.UserID;
                        table.LogOnInfo.ConnectionInfo.Password     = connInfo.Password;

                        // Apply the schema name to the table's location
                        table.Location = "dbo." + table.Location;
                    }

                    SqlConnection  con = new SqlConnection(Db.GetConnectionString());
                    SqlCommand     cmd = new SqlCommand("select * from [dbo].[vwUTLECDMRD] Where Month = 4 And Year = 2016", con);
                    SqlDataAdapter sda = new SqlDataAdapter(cmd);
                    DataSet        ds  = new DataSet();
                    sda.Fill(ds, "Newtbl_data");

                    rprt.SetDataSource(ds);
                    rprt.VerifyDatabase();

                    Label1.Text = ds.Tables[0].Rows[0]["Name"].ToString();
                    CrystalReportViewer1.ReportSource = rprt;
                }
                catch (Exception me)
                {
                    bRes = false;
                }
            }
            else
            {
            }
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Vd.isValidLogin();
            bRes = false;

            if (!IsPostBack)
            {
                hideMessageBox();
            }
            else
            {
            }
        }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Vd.isValidLogin();

            if (!IsPostBack)
            {
                ddlMonthPeriod.Items.FindByValue(DateTime.Now.Month.ToString()).Selected = true;
                txtYearPeriod.Text = DateTime.Now.Year.ToString();
                hideMessageBox();
                isEdit = false;
                loadData();
            }
        }
Example #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Vd.isValidLogin();

            if (!IsPostBack)
            {
                string v = Request.QueryString["LogOut"];
                if (v != null)
                {
                    Session["userid"] = null;
                    HttpContext.Current.Response.Redirect("./Default.aspx");
                }
            }
        }
Example #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            bRes = false;

            Vd.isValidLogin();

            if (!IsPostBack)
            {
                Session["Edit"] = false;
            }
            else
            {
            }
        }
Example #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Vd.isValidLogin();

            if (!IsPostBack)
            {
                //ddlMonthPeriod.Items.FindByValue(DateTime.Now.Month.ToString()).Selected = true;

                hideMessageBox();
                clearAll(this.Form.Controls);

                txtYearPeriod.Text = DateTime.Now.Year.ToString();
                ddlMonthPeriod.Items.FindByValue(DateTime.Now.Month.ToString()).Selected = true;

                getKWhRate();
                BindGrid();
            }
        }
Example #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            bRes = false;

            Vd.isValidLogin();

            if (!IsPostBack)
            {
                hideMessageBox();

                ddlMonthPeriod.Items.FindByValue(DateTime.Now.Month.ToString()).Selected = true;
                txtYearPeriod.Text = DateTime.Now.Year.ToString();

                BindGridSort(ddlSort.SelectedValue.ToString());
            }
            else
            {
            }
        }
Example #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Session["EditCFS"]   = null;
            Session["DetailCFS"] = null;

            Vd.isValidLogin();

            if (!IsPostBack)
            {
                bAwal   = true;
                bNoData = false;

                hideMessageBox();
                //CreateDynamicGrid();
                BindGrid();
            }
            else
            {
            }
        }
Example #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Vd.isValidLogin();

            if (!IsPostBack)
            {
                //string FilePath = Server.MapPath("~\\RptTemp\\1.pdf");
                //WebClient User = new WebClient();
                //Byte[] FileBuffer = User.DownloadData(FilePath);
                //if (FileBuffer != null)
                //{
                //    Response.ContentType = "application/pdf";
                //    Response.AddHeader("content-length", FileBuffer.Length.ToString());
                //    Response.BinaryWrite(FileBuffer);
                //}
                string filePath = Server.MapPath("~\\RptTemp\\") + Request.QueryString["FN"];
                this.Response.ContentType = "application/pdf";
                this.Response.AppendHeader("Content-Disposition;", "attachment;filename=" + Request.QueryString["FN"]);
                this.Response.WriteFile(filePath);
                this.Response.End();
            }
        }