예제 #1
0
    protected void btnShowReport_Click(object sender, EventArgs e)
    {
        DTO.Report Ob = new DTO.Report();
        Ob = SetValue();
        btnExport.Visible = false;
        var DateFromAndTo = hdnDateFromAndTo.Value.Split('-');

        Ob.FromDate        = DateFromAndTo[0].Trim();
        Ob.UptoDate        = DateFromAndTo[1].Trim();
        hdnStartDate.Value = Ob.FromDate;
        hdnEndDate.Value   = Ob.UptoDate;


        //grdReport.DataSource = ViewState["Report"]= BAL.BALFactory.Instance.Bal_Report.GetReasonToRemove(Ob, (rdrReportFrom.Checked ? "1" : (rdrReportMonthly.Checked ? "2" : (chkInvoice.Checked ? "3" : ""))), (drpSelectOption.SelectedIndex == 0 ? "1" : (drpSelectOption.SelectedIndex == 1 ? "2" : (drpSelectOption.SelectedIndex == 2 ? "3" : ""))));
        grdReport.DataSource = ViewState["Report"] = BAL.BALFactory.Instance.Bal_Report.GetReasonToRemove(Ob, (txtInvoiceNo.Text.Trim() == "" ? "1" : (txtInvoiceNo.Text.Trim() != "" ? "3" : "")), (drpSelectOption.SelectedIndex == 0 ? "1" : (drpSelectOption.SelectedIndex == 1 ? "2" : (drpSelectOption.SelectedIndex == 2 ? "3" : ""))));

        grdReport.DataBind();
        // grdReport1.DataSource = BAL.BALFactory.Instance.Bal_Report.GetReasonToRemove(Ob, (rdrReportFrom.Checked ? "1" : (rdrReportMonthly.Checked ? "2" : (chkInvoice.Checked ? "3" : ""))), (drpSelectOption.SelectedIndex == 0 ? "1" : (drpSelectOption.SelectedIndex == 1 ? "2" : (drpSelectOption.SelectedIndex == 2 ? "3" : ""))));
        grdReport1.DataSource = BAL.BALFactory.Instance.Bal_Report.GetReasonToRemove(Ob, (txtInvoiceNo.Text.Trim() == "" ? "1" : (txtInvoiceNo.Text.Trim() != "" ? "3" : "")), (drpSelectOption.SelectedIndex == 0 ? "1" : (drpSelectOption.SelectedIndex == 1 ? "2" : (drpSelectOption.SelectedIndex == 2 ? "3" : ""))));
        grdReport1.DataBind();
        if (grdReport.Rows.Count > 0)
        {
            blnRight = AppClass.CheckExportToExcelRightOnPage();
            if (blnRight)
            {
                btnExport.Visible = true;
            }
            else
            {
                btnExport.Visible = false;
            }
        }
    }
예제 #2
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     Ob        = SetValue();
     Ob.Result = BAL.BALFactory.Instance.BAL_Priority.SavePriority(Ob);
     if (Ob.Result == "Record Saved")
     {
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ScriptRegistration", "setDivMouseOver('Green', '#999999');", true);
         lblMsg.Text = "Customer preference created sucessfully.";
         BindGrid();
         RefreshForm();
     }
     else
     {
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ScriptRegistration", "setDivMouseOver('Red', '#999999');", true);
         lblErr.Text = Ob.Result;
     }
 }
예제 #3
0
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     Ob        = SetValue();
     Ob.Result = BAL.BALFactory.Instance.BAL_Remark.UpdateRemarks(Ob);
     if (Ob.Result == "Record Saved")
     {
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ScriptRegistration", "setDivMouseOver('Green', '#999999');", true);
         lblMsg.Text = "Description information updated sucessfully.";
         BindGrid();
         RefreshForm();
     }
     else
     {
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ScriptRegistration", "setDivMouseOver('Red', '#999999');", true);
         lblErr.Text = Ob.Result;
     }
 }
예제 #4
0
    protected void grdReport_Sorting(object sender, GridViewSortEventArgs e)
    {
        DTO.Report Ob = new DTO.Report();
        Ob = SetValue();

        var DateFromAndTo2 = hdnDateFromAndTo.Value.Split('-');

        Ob.FromDate        = DateFromAndTo2[0].Trim();
        Ob.UptoDate        = DateFromAndTo2[1].Trim();
        hdnStartDate.Value = Ob.FromDate;
        hdnEndDate.Value   = Ob.UptoDate;

        DataSet DS = new DataSet();

        //DS = BAL.BALFactory.Instance.Bal_Report.GetReasonToRemove(Ob, (rdrReportFrom.Checked ? "1" : (rdrReportMonthly.Checked ? "2" : (chkInvoice.Checked ? "3" : ""))), (drpSelectOption.SelectedIndex == 0 ? "1" : (drpSelectOption.SelectedIndex == 1 ? "2" : (drpSelectOption.SelectedIndex == 2 ? "3" : ""))));
        DS = BAL.BALFactory.Instance.Bal_Report.GetReasonToRemove(Ob, (txtInvoiceNo.Text.Trim() == "" ? "1" : (txtInvoiceNo.Text.Trim() != "" ? "3" : "")), (drpSelectOption.SelectedIndex == 0 ? "1" : (drpSelectOption.SelectedIndex == 1 ? "2" : (drpSelectOption.SelectedIndex == 2 ? "3" : ""))));
        DataTable DT = DS.Tables[0];

        if (DT != null)
        {
            DataView DV = new DataView(DT);
            if ((string)System.Web.HttpContext.Current.Session["Direction"] == "Asc")
            {
                DV.Sort = e.SortExpression + " " + "ASC";
                System.Web.HttpContext.Current.Session["Direction"] = "Desc";
            }
            else if ((string)System.Web.HttpContext.Current.Session["Direction"] == "Desc")
            {
                DV.Sort = e.SortExpression + " " + "DESC";
                System.Web.HttpContext.Current.Session["Direction"] = "Asc";
            }
            else
            {
                DV.Sort = e.SortExpression + " " + "ASC";
                System.Web.HttpContext.Current.Session["Direction"] = "Desc";
            }
            grdReport.DataSource = DV;
            grdReport.DataBind();
            grdReport1.DataSource = DV;
            grdReport1.DataBind();
        }
    }
 private void BindGrid()
 {
     Ob = SetValue();
     grdSearchResult.DataSource = BAL.BALFactory.Instance.BAL_RemoveReason.ShowAllReason(Ob);
     grdSearchResult.DataBind();
 }
예제 #6
0
 private void BindGrid()
 {
     Ob = SetValue();
     grdSearchResult.DataSource = BAL.BALFactory.Instance.BAL_Priority.ShowAllPriority(Ob);
     grdSearchResult.DataBind();
 }