Exemplo n.º 1
0
        private void BindCustomerNotificationDetails(int customerId)
        {
            gvNotification.Visible = false;
            DataSet dsCustomerAlerts = new DataSet();

            dsCustomerAlerts = alertsBo.GetCustomerDashboardAlert(customerId);
            if (dsCustomerAlerts.Tables[0].Rows.Count > 0)
            {
                pnlNoEntries.Visible        = false;
                gvCustomerAlerts.Visible    = true;
                gvCustomerAlerts.DataSource = dsCustomerAlerts;
                gvCustomerAlerts.DataBind();

                if (Cache["dsCustomerAlerts" + userVo.UserId.ToString()] == null)
                {
                    Cache.Insert("dsCustomerAlerts" + userVo.UserId.ToString(), dsCustomerAlerts);
                }
                else
                {
                    Cache.Remove("dsCustomerAlerts" + userVo.UserId.ToString());
                    Cache.Insert("dsCustomerAlerts" + userVo.UserId.ToString(), dsCustomerAlerts);
                }
            }
            else
            {
                pnlNoEntries.Visible = true;
            }
        }
Exemplo n.º 2
0
        //public void BindCustomerAlerts()
        //{
        //    try
        //    {
        //        dsCustomerAlerts = alertsBo.GetCustomerDashboardAlerts(customerId);
        //        if (dsCustomerAlerts.Tables[0].Rows.Count == 0)
        //        {
        //            lblAlertsMessage.Visible = true;
        //        }
        //        else
        //        {
        //            lblAlertsMessage.Visible = false;
        //            DataTable dtCustomerAlerts = new DataTable();
        //            dtCustomerAlerts.Columns.Add("Details");
        //            dtCustomerAlerts.Columns.Add("EventMessage");


        //            foreach (DataRow dr in dsCustomerAlerts.Tables[0].Rows)
        //            {
        //                drCustomerAlerts = dtCustomerAlerts.NewRow();

        //                drCustomerAlerts[0] = dr["EventCode"].ToString() + " : " + dr["Name"].ToString();
        //                drCustomerAlerts[1] = dr["EventMessage"].ToString();

        //                dtCustomerAlerts.Rows.Add(drCustomerAlerts);

        //            }
        //            gvCustomerAlerts.DataSource = dtCustomerAlerts;
        //            gvCustomerAlerts.DataBind();
        //            gvCustomerAlerts.Visible = true;
        //        }
        //    }
        //    catch (BaseApplicationException Ex)
        //    {
        //        throw Ex;
        //    }

        //    catch (Exception Ex)
        //    {
        //        BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex);
        //        NameValueCollection FunctionInfo = new NameValueCollection();

        //        FunctionInfo.Add("Method", "AdvisorRMCustIndiDashboard.ascx:BindCustomerAlerts()");


        //        object[] objects = new object[2];

        //        objects[0] = customerId;
        //        objects[1] = dsCustomerAlerts;

        //        FunctionInfo = exBase.AddObject(FunctionInfo, objects);
        //        exBase.AdditionalInformation = FunctionInfo;
        //        ExceptionManager.Publish(exBase);
        //        throw exBase;

        //    }
        //}


        public void BindCustomerAlerts()
        {
            try
            {
                dsCustomerAlerts = alertsBo.GetCustomerDashboardAlert(customerId);
                if (dsCustomerAlerts.Tables[0].Rows.Count == 0)
                {
                    lblAlertsMessage.Visible = true;
                }
                else
                {
                    lblAlertsMessage.Visible = false;


                    gvCustomerAlerts.DataSource = dsCustomerAlerts;
                    gvCustomerAlerts.DataBind();
                    gvCustomerAlerts.Visible = true;
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }

            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "AdvisorRMCustIndiDashboard.ascx:BindCustomerAlerts()");


                object[] objects = new object[2];

                objects[0] = customerId;
                objects[1] = dsCustomerAlerts;

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }