Esempio n. 1
0
        protected void grdactdact_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            grdUserAccMap.PageIndex = e.NewPageIndex;
            Hashtable htAddPlanParams = getParamsData();

            string username, catid, operator_id;

            if (Session["username"] != null || Session["operator_id"] != null)
            {
                username    = Session["username"].ToString();
                catid       = Convert.ToString(Session["category"]);
                operator_id = Convert.ToString(Session["operator_id"]);
            }
            else
            {
                Session.Abandon();
                Response.Redirect("~/Login.aspx");
                return;
            }

            Cls_Business_rptNew_Activation objTran = new Cls_Business_rptNew_Activation();
            Hashtable htResponse = objTran.GetNewActivation(htAddPlanParams, username);

            DataTable dt = null; //check for exception

            if (htResponse["htResponse"] != null)
            {
                dt = (DataTable)htResponse["htResponse"];
            }

            if (dt == null)
            {
                Response.Redirect("~/ErrorPage.aspx");
                return;
            }



            if (dt.Rows.Count == 0)
            {
                btngrnExel.Visible    = false;
                grdUserAccMap.Visible = false;
                lblSearchMsg.Text     = "No data found";
            }
            else
            {
                btngrnExel.Visible       = true;
                grdUserAccMap.Visible    = true;
                lblSearchMsg.Text        = "";
                grdUserAccMap.DataSource = dt;
                grdUserAccMap.DataBind();
            }
        }
Esempio n. 2
0
        public void Binddata()
        {
            string from = txtFrom.Text;
            string to = txtTo.Text;
            string username, catid, operator_id;

            if (Session["username"] != null || Session["operator_id"] != null)
            {
                username    = Session["username"].ToString();
                catid       = Convert.ToString(Session["category"]);
                operator_id = Convert.ToString(Session["operator_id"]);
            }
            else
            {
                Session.Abandon();
                Response.Redirect("~/Login.aspx");
                return;
            }

            Hashtable htAddPlanParams = getParamsData();

            if (htAddPlanParams != null)
            {
                Hashtable htResponse = new Hashtable();
                Cls_Business_rptNew_Activation objTran = new Cls_Business_rptNew_Activation();
                htResponse = objTran.GetNewActivation(htAddPlanParams, username);
                DataTable dt = null; //check for exception
                if (htResponse["htResponse"] != null)
                {
                    dt = (DataTable)htResponse["htResponse"];
                }

                if (dt == null)
                {
                    Response.Redirect("~/ErrorPage.aspx");
                    return;
                }

                lblSearchParams.Text = Server.HtmlDecode("<b style='color:#094791;'></b><b>Transaction From : </b>" + from + "<b>Transaction To : </b>" + to);


                if (dt.Rows.Count == 0)
                {
                    btngrnExel.Visible       = false;
                    grdNewActivation.Visible = false;
                    lblSearchMsg.Text        = "No data found";
                }
                else
                {
                    btngrnExel.Visible          = true;
                    grdNewActivation.Visible    = true;
                    lblSearchMsg.Text           = "";
                    ViewState["searched_trans"] = dt;
                    grdNewActivation.DataSource = dt;
                    grdNewActivation.DataBind();

                    ScriptManager.RegisterStartupScript(Page, this.GetType(), "Key", "<script>MakeStaticHeader('" + grdNewActivation.ClientID + "', 400, 1200 , 46 ,false); </script>", false);
                    DivRoot.Style.Add("display", "block");
                }
            }
            else
            {
                return;
            }
        }