Пример #1
0
    protected void ddlCompanyName_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            using (BC_Product bc = new BC_Product())
            {
                DataTable dt = new DataTable();
                dt = bc.GetList_BS_PostedAllUserDiscount(Convert.ToInt16(ddlCompanyName.SelectedValue.ToString()));

                if (dt.Rows.Count > 0)
                {
                    GridView2.DataSource = dt;
                    GridView2.DataBind();
                    Total_RecordDiscount = dt.Rows.Count;
                }
                else
                {
                    GridView2.DataSource = null;
                    GridView2.DataBind();

                    lblSystemMessageDiscount.Text  = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" style=\"width:606px; background-color:#3B5998;\">";
                    lblSystemMessageDiscount.Text += "<tr>";
                    lblSystemMessageDiscount.Text += "<td align=\"center\" style=\"height:45px; color:#FFFFFF; font-size:14px; font-weight:bold;\" valign=\"middle\">";
                    lblSystemMessageDiscount.Text += "<span class=\"title\" style=\"font-size:14px;\">";
                    lblSystemMessageDiscount.Text += "</span> You have not posted any Corporate Ads yet.";
                    lblSystemMessageDiscount.Text += "</td>";
                    lblSystemMessageDiscount.Text += "</tr>";
                    lblSystemMessageDiscount.Text += "</table>";
                    lblSystemMessageDiscount.Text  = UTLUtilities.ShowGeneralMessageCP("No Discount posted");
                }
            }
        }
        catch (Exception ex)
        {
            lblSystemMessageDiscount.Text = ex.Message.ToString();
        }
    }