private void AddUpdateNotification()
    {
        AdminNotificationInfo ObjInfo = new AdminNotificationInfo();

        ObjInfo.NotificationID = Int32.Parse(hdnNotificationID.Value.Trim());
        ObjInfo.Name           = txtName.Text;
        ObjInfo.Message        = txtMessage.Text;
        ObjInfo.PageUrl        = txtPageUrl.Text;
        ObjInfo.Status         = status;
        ObjInfo.NotifyUserName = string.Empty;
        ObjInfo.IsActive       = chkIsActive.Checked;
        AdminNotificationController controller = new AdminNotificationController();
        int result = controller.AddUpdateNotification(GetPortalID, GetUsername, ObjInfo);

        pnlNotificationForm.Visible = false;
        pnlNotificationGrid.Visible = true;
        BindNotification();
        ClearForm();
        if (result == 1)
        {
            ShowMessage("", "Notification Saved Successfully", "", SageMessageType.Success);
        }
        else if (result == 2)
        {
            ShowMessage("", "Notification Updated Successfully", "", SageMessageType.Success);
        }
        else if (result == -1)
        {
            ShowMessage("", "Notification Name Already Exist", "", SageMessageType.Alert);
        }
        else
        {
            ShowMessage("", "Error occured", "", SageMessageType.Alert);
        }
    }
Exemplo n.º 2
0
        public IHttpActionResult SendAdminNotification([FromBody] AdminNotificationInfo adminNotificationInfo)
        {
            Require.NotNull(adminNotificationInfo, nameof(adminNotificationInfo));

            _eventBus.PublishEvent("Notification", "admin_notification_info", adminNotificationInfo);

            return(Ok());
        }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string[] paramColl = GetUrlParameters;
        if (paramColl != null && paramColl.Length > 0)
        {
            MessageID = int.Parse(paramColl[1]);
            AdminNotificationController controller = new AdminNotificationController();
            AdminNotificationInfo       objInfo    = controller.GetNotificationDetail(GetPortalID, MessageID);
            lblAdminMessage.Text = objInfo.MessageDetails;
        }

        lblErrorMsg.Text = "";
    }
    private void EditNotification(int ID)
    {
        AdminNotificationController controller = new AdminNotificationController();
        AdminNotificationInfo       objInfo    = controller.GetNotificationDetail(GetPortalID, ID);

        if (objInfo != null)
        {
            txtName.Text            = objInfo.Name;
            txtMessage.Text         = objInfo.Message;
            status                  = objInfo.Status;
            chkIsActive.Checked     = objInfo.IsActive;
            txtPageUrl.Text         = objInfo.PageUrl;
            hdnNotificationID.Value = objInfo.NotificationID.ToString();
        }
        pnlNotificationForm.Visible = true;
        pnlNotificationGrid.Visible = false;
        btnSaveContent.Text         = "Update";
    }
Exemplo n.º 5
0
    public void UpgradeSystem(int MessageID)
    {
        AdminNotificationController controller = new AdminNotificationController();
        AdminNotificationInfo       objInfo    = controller.GetNotificationDetail(GetPortalID, MessageID);

        try
        {
            WebClient client = new WebClient();
            fileName = System.IO.Path.GetFileName(objInfo.PackageLink);
            string tempFolder = HostingEnvironment.ApplicationPhysicalPath + "Upgrade";
            savePath = tempFolder + "\\" + fileName;
            if (!Directory.Exists(tempFolder))
            {
                Directory.CreateDirectory(tempFolder);
            }
            client.DownloadFileCompleted += new System.ComponentModel.AsyncCompletedEventHandler(client_DownloadFileCompleted);
            client.DownloadFileAsync(new Uri(objInfo.PackageLink), savePath, fileName);
            errorMessage = string.Empty;
        }
        catch (Exception ex)
        {
            ShowMessage("", ex.ToString(), "", SageMessageType.Error);
        }
    }
Exemplo n.º 6
0
 private string Describe(AdminNotificationInfo @event)
 {
     return(string.Format(@event.InfoText));
 }
Exemplo n.º 7
0
 public void NotifyAboutAdminNotificationInfo(AdminNotificationInfo @event)
 {
     NotifyAboutNewEvent(@event);
 }