コード例 #1
0
ファイル: Note_Class.cs プロジェクト: villena/StickyNotes
 //Add new note
 public bool addNote(int id)
 {
     Note_CAD u = new Note_CAD();
     if (u.addNote(this,id))
     {
         return true;
     }
     else
     {
         return false;
     }
 }
コード例 #2
0
ファイル: Default.aspx.cs プロジェクト: villena/StickyNotes
        protected void Page_Load(object sender, EventArgs e)
        {
            Panel p = new Panel();
            Panel psub = new Panel();
            Label t = new Label();
            Label a = new Label();

            Note_CAD notaTemp = new Note_CAD();
            List<Note_Class> notes = new List<Note_Class>();
            User_Class user = new User_Class();

            notes = notaTemp.notesOpen();

            int i = notes.Count() - 1;
            int j = i-12;

            while (i >= 0 && i > j)
            {
                p = new Panel();

                t = new Label();
                a = new Label();
                psub = new Panel();

                string id = notes[i].Id.ToString();

                psub.CssClass = "default_panel";
                psub.HorizontalAlign = HorizontalAlign.Right;

                p.ID = "p" + id;
                p.CssClass = "postitnotes";
                t.ID = "t" + id;
                a.Text = "a" + id;

                t.Text = notes[i].Text.ToString() + "<BR>";
                a.Text = user.getUser(notes[i].Author).Nick;
                a.CssClass = "noteauthor";

                psub.Controls.Add(a);

                p.Controls.Add(t);
                p.Controls.Add(psub);

                Panel1.Controls.Add(p);

                i--;

            }
        }
コード例 #3
0
ファイル: Notes.aspx.cs プロジェクト: villena/StickyNotes
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.MaintainScrollPositionOnPostBack = true;
            HttpCookie userCookie;
            HttpCookie passCookie;

            userCookie = Request.Cookies["UserID"];
            passCookie = Request.Cookies["UserPass"];

            if (userCookie == null || passCookie == null)
            {
                Response.Redirect("../Account/Login.aspx");
            }
            else
            {
                User_Class usuario_sesion = new User_Class();
                usuario_sesion = usuario_sesion.getUser(userCookie.Value);

                if (usuario_sesion.Pass == passCookie.Value)
                {
                    Panel p = new Panel();

                    Label t = new Label();
                    Label f = new Label();
                    Image ie = new Image();
                    ie.ImageUrl = "../Images/editButton.png";
                    ImageButton imgbuttone = new ImageButton();
                    ImageButton imgbuttonb = new ImageButton();
                    User_Class userNote = new User_Class();
                    Label a = new Label();

                    Panel psub = new Panel();

                    Note_CAD notaTemp = new Note_CAD();
                    List<Note_Class> notes = new List<Note_Class>();

                    User_Class userTemp = new User_Class();
                    userTemp = userTemp.getUser(userCookie.Value);

                    notes = notaTemp.notesUser(userTemp.Id);

                    int i = notes.Count() - 1;

                    while (i >= 0)
                    {
                        p = new Panel();
                        psub = new Panel();

                        t = new Label();
                        f = new Label();
                        a = new Label();
                        userNote = new User_Class();

                        imgbuttone = new ImageButton();
                        imgbuttonb = new ImageButton();

                        imgbuttone.ImageUrl = "../Images/editButton.png";
                        imgbuttone.PostBackUrl = "~/Asp_forms/Editnotes.aspx?ID=" + notes[i].Id.ToString();
                        imgbuttone.Width = 30;
                        imgbuttone.ToolTip = "Edit";

                        imgbuttonb.ImageUrl = "../Images/deleteButton.png";
                        imgbuttonb.PostBackUrl = "~/Asp_forms/Deletenote.aspx?ID=" + notes[i].Id.ToString();
                        imgbuttonb.Width = 30;
                        imgbuttonb.ToolTip = "Delete";

                        psub.CssClass = "default_panel";
                        psub.HorizontalAlign = HorizontalAlign.Right;

                        a.Text = "<br/>" +userNote.getUser(notes[i].Author).Nick;
                        a.CssClass = "noteauthor";

                        psub.Controls.Add(imgbuttonb);
                        psub.Controls.Add(imgbuttone);
                        psub.Controls.Add(a);

                        string id = notes[i].Id.ToString();

                        p.ID = "p" + id;
                        if (notes[i].Type == 'O')
                            p.CssClass = "postitnotes";
                        else if (notes[i].Type == 'P')
                            p.CssClass = "postitnotespink";
                        t.ID = "t" + id;
                        f.ID = "f" + id;

                        t.Text = notes[i].Text.ToString() + "<BR>";

                        p.Controls.Add(t);
                        p.Controls.Add(f);

                        p.Controls.Add(psub);
                        Panel1.Controls.Add(p);

                        i--;
                    }
               }
                else
                {
                    Response.Redirect("../Account/Login.aspx");
                }
            }
        }
コード例 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            HttpCookie userCookie;
            HttpCookie passCookie;

            userCookie = Request.Cookies["UserID"];
            passCookie = Request.Cookies["UserPass"];

            if (userCookie == null || passCookie == null)
            {
                Response.Redirect("../Account/Login.aspx");
            }
            else
            {
                User_Class usuario_sesion = new User_Class();
                usuario_sesion = usuario_sesion.getUser(userCookie.Value);

                if (usuario_sesion.Pass == passCookie.Value)
                {
                    int categoryid = int.Parse(Request.QueryString["id"]);
                    Category_Class category = new Category_Class();
                    category = category.getCategoria(categoryid);

                    CategoryLabel.Text = category.Nombre + " Notes";
                    Panel p = new Panel();

                    Label t = new Label();
                    Label f = new Label();
                    Image ie = new Image();
                    ie.ImageUrl = "../Images/editButton.png";
                    ImageButton imgbuttone = new ImageButton();
                    ImageButton imgbuttonb = new ImageButton();

                    Panel psub = new Panel();

                    Note_CAD notaTemp = new Note_CAD();
                    List<Note_Class> notes = new List<Note_Class>();

                    User_Class userTemp = new User_Class();
                    userTemp = userTemp.getUser(userCookie.Value);

                    notes = notaTemp.notesCategory(userTemp.Id, category.Id);

                    int i = notes.Count() - 1;
                    if (notes.Count() == 0)
                    {
                        noCategories.Text = "No " + category.Nombre + " notes found. Start creating one up here!";
                    }
                    else
                    {
                        while (i >= 0)
                        {
                            p = new Panel();
                            psub = new Panel();

                            t = new Label();
                            f = new Label();

                            imgbuttone = new ImageButton();
                            imgbuttonb = new ImageButton();

                            imgbuttone.ImageUrl = "../Images/editButton.png";
                            imgbuttone.PostBackUrl = "~/Asp_forms/Editnotes.aspx?ID=" + notes[i].Id.ToString();
                            imgbuttone.Width = 30;
                            imgbuttone.ToolTip = "Edit";

                            imgbuttonb.ImageUrl = "../Images/deleteButton.png";
                            imgbuttonb.PostBackUrl = "~/Asp_forms/Deletenote.aspx?ID=" + notes[i].Id.ToString();
                            imgbuttonb.Width = 30;
                            imgbuttonb.ToolTip = "Delete";

                            psub.CssClass = "default_panel";
                            psub.HorizontalAlign = HorizontalAlign.Right;

                            psub.Controls.Add(imgbuttonb);
                            psub.Controls.Add(imgbuttone);

                            string id = notes[i].Id.ToString();

                            p.ID = "p" + id;
                            p.CssClass = "postitnotes";
                            t.ID = "t" + id;
                            f.ID = "f" + id;

                            t.Text = notes[i].Text.ToString() + "<BR>";

                            p.Controls.Add(t);
                            p.Controls.Add(f);

                            p.Controls.Add(psub);
                            Panelnota.Controls.Add(p);

                            i--;
                        }

                    }
                }
                else
                {
                    Response.Redirect("../Account/Login.aspx");
                }
            }
        }
コード例 #5
0
ファイル: Note_Class.cs プロジェクト: villena/StickyNotes
 public bool addNote(int authorid, List<User_Class> users)
 {
     Note_CAD u = new Note_CAD();
     if (u.addNote(this, authorid, users))
     {
         return true;
     }
     else
     {
         return false;
     }
 }
コード例 #6
0
ファイル: Note_Class.cs プロジェクト: villena/StickyNotes
 //Modify text
 public bool modifyNote(Note_Class notec)
 {
     Note_CAD u = new Note_CAD();
     if (u.modifyNote(notec))
     {
         return true;
     }
     else
     {
         return false;
     }
 }
コード例 #7
0
ファイル: Note_Class.cs プロジェクト: villena/StickyNotes
        public List<Note_Class> getNotesUserPrivate(int id)
        {
            Note_CAD cadNote = new Note_CAD();

            return cadNote.notesUserPrivate(id);
        }
コード例 #8
0
ファイル: Note_Class.cs プロジェクト: villena/StickyNotes
        public List<Note_Class> getNotesOpen()
        {
            Note_CAD cadNote = new Note_CAD();

            return cadNote.notesOpen();
        }
コード例 #9
0
ファイル: Note_Class.cs プロジェクト: villena/StickyNotes
        public List<Note_Class> getNotesGroup(int id_group)
        {
            Note_CAD cadNote = new Note_CAD();

            return cadNote.notesGroups(id_group);
        }
コード例 #10
0
ファイル: Note_Class.cs プロジェクト: villena/StickyNotes
        public Note_Class getNote(int id)
        {
            Note_CAD ncad = new Note_CAD();

            Note_Class note = ncad.getNote(id);

            return note;
        }
コード例 #11
0
ファイル: Note_Class.cs プロジェクト: villena/StickyNotes
 //Delete friend
 public bool deleteNote()
 {
     Note_CAD u = new Note_CAD();
     if (u.deleteNote(this))
     {
         return true;
     }
     else
     {
         return false;
     }
 }