protected void uiRepeaterInteranetMenu_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Label lblNot = e.Item.FindControl("lblNotification") as Label;
                HiddenField hfRep = e.Item.FindControl("hfRepeater") as HiddenField;
                UsersNofications userNotif = new UsersNofications();
                switch (hfRep.Value.ToString())
                {
                    case "Circulars":
                        userNotif.getNotificationsByNotificationType(new Guid(Membership.GetUser(Page.User.Identity.Name).ProviderUserKey.ToString()), 1);
                        userNotif.GetColumn("NotifCount");
                        lblNot.Text = userNotif.GetColumn("NotifCount").ToString();
                        break;
                    case "Bulletins":
                        userNotif.getNotificationsByNotificationType(new Guid(Membership.GetUser(Page.User.Identity.Name).ProviderUserKey.ToString()), 2);
                        userNotif.GetColumn("NotifCount");
                        lblNot.Text = userNotif.GetColumn("NotifCount").ToString();
                        break;

                    case "Manuals":
                        userNotif.getManualsNotificationCounter(new Guid(Membership.GetUser(Page.User.Identity.Name).ProviderUserKey.ToString()));
                        userNotif.GetColumn("NotifCount");
                        lblNot.Text = userNotif.GetColumn("NotifCount").ToString();
                        break;

                    case "AircraftManuals":
                        userNotif.getNotificationsByNotificationType(new Guid(Membership.GetUser(Page.User.Identity.Name).ProviderUserKey.ToString()), 5);
                        userNotif.GetColumn("NotifCount");
                        lblNot.Text = userNotif.GetColumn("NotifCount").ToString();
                        break;
                    case "Blogs":
                        userNotif.getNotificationsByNotificationType(new Guid(Membership.GetUser(Page.User.Identity.Name).ProviderUserKey.ToString()), 6);
                        userNotif.GetColumn("NotifCount");
                        lblNot.Text = userNotif.GetColumn("NotifCount").ToString();
                        break;

                    case "Certificates":
                        userNotif.getNotificationsByNotificationType(new Guid(Membership.GetUser(Page.User.Identity.Name).ProviderUserKey.ToString()), 7);
                        userNotif.GetColumn("NotifCount");
                        lblNot.Text = userNotif.GetColumn("NotifCount").ToString();
                        break;

                    case "Schedules":
                        userNotif.getNotificationsByNotificationType(new Guid(Membership.GetUser(Page.User.Identity.Name).ProviderUserKey.ToString()), 8);
                        userNotif.GetColumn("NotifCount");
                        lblNot.Text = userNotif.GetColumn("NotifCount").ToString();
                        break;

                    default:
                        lblNot.Visible = false;
                        break;
                }
                if (lblNot.Text != "0")
                {
                    lblNot.Visible = true;
                }

            }
        }
 //protected void MarkNotificationsAsRead()
 //{
 //    UsersNofications userNotif = new UsersNofications();
 //    userNotif.MarkNotificationsRead((new Guid(Membership.GetUser(Page.User.Identity.Name).ProviderUserKey.ToString())), 3);
 //}
 protected void MarkNotificationsAsRead()
 {
     UsersNofications userNotif = new UsersNofications();
     if(currentManualCat != 12)
         userNotif.MarkNotificationsReadByManualCategoryID((new Guid(Membership.GetUser(Page.User.Identity.Name).ProviderUserKey.ToString())), 3,currentManualCat);
     else
         userNotif.MarkNotificationsReadByManualCategoryID((new Guid(Membership.GetUser(Page.User.Identity.Name).ProviderUserKey.ToString())), 5, currentManualCat);
 }
        public static void SendNotifications(int NotificationType, int? CategoryID, int? ManualID, int? FormID, int? ManualVersionID, int? FormVersionID, int? ScheduleID, int? ScheduleVersionID)
        {
            MembershipUserCollection users = Membership.GetAllUsers();
            foreach (MembershipUser user in users)
            {
                UsersNofications userNotif = new UsersNofications();
                userNotif.AddNew();
                if (CategoryID != null)
                    userNotif.CategoryID = CategoryID.Value;
                else
                    userNotif.SetColumnNull("CategoryID");

                if (ManualID != null)
                    userNotif.ManualID = ManualID.Value;
                else
                    userNotif.SetColumnNull("ManualID");

                if (FormID != null)
                    userNotif.FormID = FormID.Value;
                else
                    userNotif.SetColumnNull("FormID");

                if (ManualVersionID != null)
                    userNotif.ManualVersionID = ManualVersionID.Value;
                else
                    userNotif.SetColumnNull("ManualVersionID");

                if (FormVersionID != null)
                    userNotif.FromVersionID = FormVersionID.Value;
                else
                    userNotif.SetColumnNull("FromVersionID");

                if (ScheduleID != null)
                    userNotif.ScheduleID = ScheduleID.Value;
                else
                    userNotif.SetColumnNull("ScheduleID");

                if (ScheduleVersionID != null)
                    userNotif.ScheduleVersionID = ScheduleVersionID.Value;
                else
                    userNotif.SetColumnNull("ScheduleVersionID");

                userNotif.UserID = new Guid(user.ProviderUserKey.ToString());
                userNotif.NotificationType = NotificationType;
                userNotif.IsRead = false;
                userNotif.Save();
            }
        }
 protected void uiInnerRepeaterIntranetMenu_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         Label lblNot = e.Item.FindControl("lblInnerNotification") as Label;
         HiddenField hfRep = e.Item.FindControl("hfInnerRepeater") as HiddenField;
         if (!string.IsNullOrWhiteSpace(hfRep.Value))
         {
             UsersNofications usNot = new UsersNofications();
             usNot.getNotificationByCatID(new Guid(Membership.GetUser(Page.User.Identity.Name).ProviderUserKey.ToString()), int.Parse(hfRep.Value.ToString()));
             usNot.GetColumn("NotifCount");
             lblNot.Text = usNot.GetColumn("NotifCount").ToString();
             if (lblNot.Text != "0")
             {
                 lblNot.Visible = true;
             }
         }
     }
 }
        public void GetFormVersions(int ID)
        {
            FromVersion versions = new FromVersion();
            versions.GetVersionsByFormID(ID);

            List<Version> AllVersions = versions.DefaultView.Table.AsEnumerable().Select(row =>
            {
                return new Version
                {
                    Title = row["Title"].ToString(),
                    IssueNumber = row["IssueNumber"].ToString(),
                    IssueDate = DateTime.Parse(row["IssueDate"].ToString()),
                    RevisionNumber = row["RevisionNumber"].ToString(),
                    RevisionDate = DateTime.Parse(row["RevisionDate"].ToString()),
                    UpdatedByName = row["UpdatedByName"].ToString(),
                    LastUpdatedDate = DateTime.Parse(row["LastUpdatedDate"].ToString()),
                    Path = row["Path"].ToString()
                };

            }).ToList();
            UsersNofications usNot = new UsersNofications();
            usNot.MarkNotificationReadByFormVersionID(new Guid(Membership.GetUser(Context.User.Identity.Name).ProviderUserKey.ToString()), ID);
            SetContentResult(AllVersions);
        }
 private void MarkNotificationsAsRead()
 {
     UsersNofications userNotif = new UsersNofications();
     userNotif.MarkNotificationsReadByNotificationType((new Guid(Membership.GetUser(Page.User.Identity.Name).ProviderUserKey.ToString())), 7);
 }
Beispiel #7
0
 protected void MarkNotificationsAsRead()
 {
     UsersNofications userNotif = new UsersNofications();
     userNotif.MarkNotificationReadByFormID((new Guid(Membership.GetUser(Page.User.Identity.Name).ProviderUserKey.ToString())),CurrentManual);
 }
 protected void MarkNotificationsAsRead()
 {
     UsersNofications userNotif = new UsersNofications();
     //userNotif.MarkNotificationsReadByNotificationType((new Guid(Membership.GetUser(Page.User.Identity.Name).ProviderUserKey.ToString())), 8);
     userNotif.MarkSchedulesNotificationsRead((new Guid(Membership.GetUser(Page.User.Identity.Name).ProviderUserKey.ToString())), 8);
 }