コード例 #1
0
    protected void btnShowReport_Click(object sender, EventArgs e)
    {
        try{
            if (ddlReportType.SelectedValue == "")
            {
            }

            DataTable dt = StudentManager.GetStudentAllCurrentStatus("", txtSearchBatch.Text, "", "");
            dgPayHistory.DataSource = dt;
            dgPayHistory.DataBind();
            Up1.Update();
        }
        catch (FormatException fex)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "Warning", "alert('" + fex.Message + "');", true);
        }
        catch (Exception ex)
        {
            if (ex.Message.Contains("Database"))
            {
                ClientScript.RegisterStartupScript(this.GetType(), "Warning", "alert('Database Maintain Error. Contact to the Software Provider..!!');", true);
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "Warning", "alert('There is some problem to do the task. Try again properly.!!');", true);
            }
        }
    }
コード例 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         dt.Columns.AddRange(new DataColumn[9] {
             new DataColumn("ItemCode", typeof(String)),
             new DataColumn("ItemCategory", typeof(string)),
             new DataColumn("ItemDescription", typeof(string)),
             new DataColumn("QtyAdjusted", typeof(int)),
             new DataColumn("Deduct", typeof(bool)),
             new DataColumn("Price", typeof(double)),
             new DataColumn("Amount", typeof(double)),
             new DataColumn("Reason", typeof(String)),
             new DataColumn("key", typeof(int))
         });
         Session["data"]        = dt;
         ddlCategory.DataSource = ssControl.getCategoryList();
         ddlCategory.DataBind();
         Up1.Update();
         lblDisplayDate.Text = DateTime.Now.Date.ToShortDateString();
         btnSubmit.Visible   = false;
         btnCancel.Visible   = false;
         lblStatus.ForeColor = System.Drawing.Color.Green;
         lblStatus.Text      = "Please select the items";
     }
 }
コード例 #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     statusMessage = this.Master.FindControl("LblStatus") as Label;
     if (!IsPostBack)
     {
         BindGrid();
     }
     Up1.Update();
 }
コード例 #4
0
 protected void ddlReportType_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ddlReportType.SelectedValue == "DWR")
     {
         txtEndDate.Visible     = true;
         txtStartDate.Visible   = true;
         Label2.Visible         = true;
         Label3.Visible         = true;
         txtSearchBatch.Visible = false;
         Label2.Text            = "Start Date";
     }
     if (ddlReportType.SelectedValue == "BWR")
     {
         txtEndDate.Visible     = false;
         txtStartDate.Visible   = false;
         Label2.Visible         = true;
         Label3.Visible         = false;
         txtSearchBatch.Visible = true;
         Label2.Text            = "Batch No";
     }
     if (ddlReportType.SelectedValue == "DWEL")
     {
         txtEndDate.Visible     = true;
         txtStartDate.Visible   = true;
         Label2.Visible         = true;
         Label3.Visible         = true;
         txtSearchBatch.Visible = false;
         Label2.Text            = "Start Date";
     }
     if (ddlReportType.SelectedValue == "CR")
     {
         txtEndDate.Visible     = true;
         txtStartDate.Visible   = true;
         Label2.Visible         = true;
         Label3.Visible         = true;
         txtSearchBatch.Visible = false;
         Label2.Text            = "Start Date";
     }
     else
     {
     }
     Up1.Update();
 }