Example #1
0
    private void BindReport(string frmdate, string todate)
    {
        DataSet ds;

        //int count = 0;
        //string counter = "";
        try
        {
            if (txtSearchMobile.Text == "")
            {
                objSMS.Mobileno = Convert.ToString(Session["Mobile"]);
                ds = objSMS.BLLSMSReport(objSMS);
                grdsntmsg.DataSource = ds.Tables[0];
                grdsntmsg.DataBind();
            }
            else
            {
                objSMS.Mobileno = txtSearchMobile.Text;
                ds = objSMS.BLLSMSReportByMobile(objSMS);
                grdsntmsg.DataSource = ds.Tables[0];
                grdsntmsg.DataBind();
            }
        }
        catch (Exception ex)
        {
        }
    }
Example #2
0
    private void BindReport(string frmdate, string todate)
    {
        DataSet ds;
        int     count   = 0;
        string  counter = "";

        try
        {
            if (ddlcode.SelectedIndex == 0)
            {
                ds      = objSMS.BLLSMSReport(objSMS);
                counter = objSMS.BLLSMSReportcount(objSMS);
            }
            else
            {
                objSMS.Sendercode = Convert.ToInt32(ddlcode.SelectedItem.Value);
                ds      = objSMS.BLLgetsmsbyid(objSMS);
                counter = objSMS.BLLgetsmsbyidcount(objSMS);
            }

            gvReport.DataSource = ds.Tables[0];
            gvReport.DataBind();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                int sqlcount = Convert.ToInt32(dr["smslength"]);
                if (sqlcount < 160)
                {
                    count = count + 1;
                }
                else if (sqlcount > 160)
                {
                    count = count + 2;
                }
                else if (sqlcount > 320)
                {
                    count = count + 3;
                }
                else if (sqlcount > 480)
                {
                    count = count + 4;
                }
            }

            lblttlsms.Visible   = true;
            lbltotalsms.Visible = true;
            lblsms.Visible      = true;
            lbltotal.Visible    = true;
            lbltotal.Text       = count.ToString();
            lbltotalsms.Text    = counter.ToString();
        }
        catch (Exception ex)
        {
        }
    }