예제 #1
0
        protected void drpdwnlstApp_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                string connstr = System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString1"].ConnectionString;
                int app = Convert.ToInt32(drpdwnlstApp.SelectedItem.Value);
                string ClNm;
                //Yogita
                #region
                //Edited Stored procedure to serch by client name and approve
                BLViewClient blVwCl = new BLViewClient();
                if (txtSearchCl.Text == "")
                {
                    ClNm = "NA";
                }
                else
                {
                    ClNm = txtSearchCl.Text;
                }
                SqlDataReader dr = blVwCl.GetClientByNameType1(ClNm, app);
                if (dr.HasRows)
                {
                    GdVwViewClient.DataSource = dr;
                    GdVwViewClient.DataBind();

                }
                else
                {
                    lblErrorMsg.Text = "Records not available";
                    GdVwViewClient.DataSource = null;
                    GdVwViewClient.DataBind();
                }
                #endregion
            }
            catch (Exception ex)
            {
                lblCatchError.Text = ex.Message.ToString();
            }
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if ((HttpContext.Current.Session["LoginId"]) == null)
                {
                    Response.Redirect("~/Login.aspx");
                }
                if (!Page.IsPostBack)
                {
                    int app;
                    if (drpdwnlstApp.SelectedItem.Text == "Approve")
                        app = 1;
                    else app = 0;
                    string ClNm = drpdwnlstApp.SelectedItem.Text;

                    BLViewClient blVwCl = new BLViewClient();
                    SqlDataReader dr = blVwCl.GetClientAtLoad1();
                    if (dr.HasRows)
                    {
                        GdVwViewClient.DataSource = dr;
                        GdVwViewClient.DataBind();
                    }
                    else
                    {
                        lblErrorMsg.Text = "Records not available";
                        GdVwViewClient.DataSource = null;
                        GdVwViewClient.DataBind();
                    }
                    dr.Close();
                }
                else
                {
                    lblErrorMsg.Text = "";
                    lblCatchError.Text = "";
                }
            }
            catch (Exception ex)
            {
                lblCatchError.Text = ex.Message.ToString();
            }
        }