Esempio n. 1
0
        public void DataBind()
        {
            CommunityAlert        ca     = new CommunityAlert();
            List <CommunityAlert> caList = ca.GetAllCommunityPartnerAlertView();

            gvAlerts.DataSource = caList;
            gvAlerts.DataBind();
        }
Esempio n. 2
0
        public List <CommunityAlert> GetAllCommunityPartnerAlertView()
        {
            var reader = dbHelper.GetCommunityPartnerAlert(Constant.SP_CommunityPartnerAlertView);
            List <CommunityAlert> caList = new List <CommunityAlert>();
            CommunityAlert        ca     = null;

            while (reader.Read())
            {
                ca         = new CommunityAlert();
                ca.AlertID = Convert.ToInt32(reader["AlertID"]);
                ca.Message = reader["Message"].ToString();
                ca.Date    = Convert.ToDateTime(reader["Date"]);

                caList.Add(ca);
            }
            return(caList);
        }
Esempio n. 3
0
        protected void DeleteAlert(object sender, EventArgs e)
        {
            //Get the button that raised the event
            Button Delete = (Button)sender;

            //Get the row that contains this event
            GridViewRow gvr        = (GridViewRow)Delete.NamingContainer;
            Label       lblAlertID = ((Label)gvr.FindControl("lblAlertID"));
            Label       lblCPID    = ((Label)gvr.FindControl("lblCPID"));
            Label       Message    = ((Label)gvr.FindControl("lblMessage"));
            Label       Date       = ((Label)gvr.FindControl("lblDate"));
            //Datasource
            CommunityAlert ca = new CommunityAlert();

            ca.AlertID = Convert.ToInt32(lblAlertID.Text);
            ca.DeleteAlertMessage();
            //DataBind
            DataBind();
        }