Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Master.PageHeading = "Complaint Registration";
            DateTime dtime = DateTime.Now;

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

            if (!IsPostBack)
            {
                lblSearchResponse.Text = "";
                //CRMClassLib.MstMethods.Dropdown.Fill(DdlComplaintType, "aomcm_complainttype_def", "var_complnttyp_type", "num_complnttyp_id", "num_corp_id= " + Session["CORPID"] + " and var_complnttyp_activeflag='Y'", "");
                DataSet ds = Cls_Helper.fnGetdataset("select var_complnttyp_type,num_complnttyp_id from crm.aomcm_complainttype_def where var_complnttyp_activeflag='Y'");
                ddlcomplainttype.DataSource     = ds;
                ddlcomplainttype.DataTextField  = "var_complnttyp_type";
                ddlcomplainttype.DataValueField = "num_complnttyp_id";
                ddlcomplainttype.DataBind();
                ds.Dispose();
                ddlcomplainttype.Items.Insert(0, "--- Select ---");
                if (RadSearchby.SelectedValue == "1")
                {
                    divdet.Visible      = false;
                    divcustomer.Visible = true;
                }
                else
                {
                    divcustomer.Visible = false;
                    divdet.Visible      = false;
                }
                txtFrom.Attributes.Add("readonly", "readonly");
                txtTo.Attributes.Add("readonly", "readonly");

                txtFrom.Text = dtime.ToString("dd-MMM-yyyy").Trim();
                txtTo.Text   = dtime.ToString("dd-MMM-yyyy").Trim();
                RadSearchby_SelectedIndexChanged(null, null);
            }
        }
Beispiel #2
0
        protected void binddata(string qry, GridView gr)
        {
            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 = ddlLco.SelectedValue;//Convert.ToString(Session["operator_id"]);
            }
            else
            {
                Session.Abandon();
                Response.Redirect("~/Login.aspx");
                return;
            }
            DataSet dt = new DataSet();


            dt = Cls_Helper.fnGetdataset(qry);

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


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