Пример #1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            string startTime = this.fdate.Text;
            string endTime = this.tdate.Text;
            DataTable dt = new DataTable();
            string param = string.Empty;

            if (!string.IsNullOrEmpty(startTime) && !string.IsNullOrEmpty(endTime))
            {
                if (DateTime.Parse(startTime).CompareTo(DateTime.Parse(endTime)) > 0)
                {
                    Common.yvonYmPrompt.AlertError("Start time than end time !", this.Page, "cleanyvon");
                   return;
                }
                param = string.Format(" and date between '{0}' and '{1}';", startTime,endTime);

            }
            else if (string.IsNullOrEmpty(startTime) && !string.IsNullOrEmpty(endTime))
            {
                param = string.Format(" and date <= '{0}';", endTime);
            }
            else if (!string.IsNullOrEmpty(startTime) && string.IsNullOrEmpty(endTime))
            {
                param = string.Format(" and date >= '{0}';", startTime);
            }

            dt = new AdminBLL().getMessageList(param);

            this.GridView1.DataSource = dt;
            this.GridView1.DataBind();
        }
Пример #2
0
        private void LoadMessage()
        {
            DataTable dt = new AdminBLL().getMessageList(";");
            if (dt.Rows.Count > 0)
            {
                Message = dt.Rows[0]["message"].ToString();
            }

            string param = string.Format(" and owner='{0}';", lblUserName.Text);
            dt = new AdminBLL().getMessageList(param);
            if (null != dt)
            {
                Count = dt.Rows.Count;
            }
        }
Пример #3
0
 private void BindMessageSource()
 {
     DataTable dt = new DataTable();
     if (!string.IsNullOrEmpty(Request.QueryString["userName"]))
     {
         string param = string.Format(" and owner='{0}';", Request.QueryString["userName"]);
         dt = new AdminBLL().getMessageList(param);
     }
     else
     {
         dt = new AdminBLL().getMessageList(";");
     }
     this.GridView1.DataSource = dt;
     this.GridView1.DataBind();
 }