Beispiel #1
0
 bool SendNotifications(InviteeList inviteeList, NotificationType type, string sender, string comments, string ideaId)
 {
     try
     {
         string ideaName = string.Empty;
         if (type == NotificationType.CreateIdea || type == NotificationType.UpdateIdea)
         {
             ideaName = ideaId;
         }
         else
         {
             Idea idea = _iIdeaRepository.GetIdeaDetails(_email, _author, ideaId);
             ideaName = idea.Title;
         }
         SendNotification(inviteeList.IdeaModerators, ReceiverType.Approver, type, sender, comments, ideaName);
         if (inviteeList.IdeaCreator != null)
         {
             SendNotification(inviteeList.IdeaCreator, ReceiverType.Creator, type, sender, comments, ideaName);
         }
         if (inviteeList.IdeaPicker != null)
         {
             SendNotification(inviteeList.IdeaPicker, ReceiverType.Picker, type, sender, comments, ideaName);
         }
         SendNotification(inviteeList.IdeaWatchers, ReceiverType.Watcher, type, sender, comments, ideaName);
         SendNotification(inviteeList.IdeaCommenters, ReceiverType.Commenter, type, sender, comments, ideaName);
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Beispiel #2
0
        public Response RejectIdea(string name, String ideaId, string email, string author, string userComments)
        {
            InviteeList inviteeList = _iIdeaRepository.RejectIdea(ideaId, email, author, userComments);

            if (inviteeList.IsSuccess)
            {
                _email = email; _author = author;
                SendNotifications(inviteeList, NotificationType.RejectIdea, name, userComments, ideaId);
            }
            return(new Response(inviteeList.IsSuccess, inviteeList.Message));
        }
Beispiel #3
0
        public Response UpdateIdea(string name, Idea idea, string email, string author)
        {
            InviteeList inviteeList = _iIdeaRepository.UpdateIdea(idea, email, author);

            if (inviteeList.IsSuccess)
            {
                _email = email; _author = author;
                SendNotifications(inviteeList, NotificationType.UpdateIdea, name, "", idea.Title);
            }
            return(new Response(inviteeList.IsSuccess, inviteeList.Message));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!this.IsPostBack)
                {
                    var token = Session["TOKEN"] as string;
                    var user  = TokenManager.Identifytoken(token);
                    if (user != null)
                    {
                        var context = new MOMEntities();
                        var ID      = context.ROLETABLE.SingleOrDefault(x => x.ROLE == "CP");

                        var origin = context.DETAILSTABLE.Where(s => s.ROLE == ID.ROLEID).ToList();
                        origin = origin.OrderBy(c => c.FIRSTNAME).ToList();

                        DataSet o = new DataSet();
                        ChairpersonList.DataSource = origin;


                        ChairpersonList.DataTextField = "FullName";


                        ChairpersonList.DataValueField = "UNIQUEID";
                        ChairpersonList.DataBind();

                        var Invitees = context.DETAILSTABLE.ToList();
                        InviteeList.DataSource     = Invitees;
                        InviteeList.DataTextField  = "FullName";
                        InviteeList.DataValueField = "UNIQUEID";
                        InviteeList.DataBind();
                        var Department = context.DEPARTMENTTABLE.ToList();
                        ListBox1.DataSource     = Department;
                        ListBox1.DataTextField  = "DEPARTMENT";
                        ListBox1.DataValueField = "KEY";
                        ListBox1.DataBind();
                        //this.BindGrid();
                    }
                    else
                    {
                        Response.Redirect("Login.aspx");
                    }
                }
            }
        }