Ejemplo n.º 1
0
        protected void btnsendchat_ServerClick(object sender, EventArgs e)
        {
            Chatmanagement.ChatClient chat = new Chatmanagement.ChatClient();
            UserData user = (UserData)Session["User"];

            chat.Open();
            if (txtsend.Equals(""))
            {
                Invlaidproject.InnerHtml += "<p>No message to send.</p>";
            }
            else
            {
                int result = chat.insertissuechat(txtsend.Value.ToString(), id, user.getID());
                if (result == 1)
                {
                    chat.Close();

                    Page.Response.Redirect(Page.Request.Url.ToString(), true);
                }

                chat.Close();
            }


            chat.Close();
        }
Ejemplo n.º 2
0
        protected void btnissdelete_ServerClick(object sender, EventArgs e)
        {
            Dataservice.DatamanagementClient findata = new Dataservice.DatamanagementClient();
            Chatmanagement.ChatClient        chat    = new Chatmanagement.ChatClient();
            chat.Open();
            UserData user = (UserData)Session["User"];

            findata.Open();

            int deletechat    = chat.deleteissuechat(pid);
            int deleteissnoti = findata.deleteissnoticeiss(pid);
            int deleteissteam = findata.deleteissteam(pid);
            int iss           = findata.deleteissue(pid);

            if (iss == 1)
            {
                changePagedelete();
            }
            else
            {
                changePageerror();
            }

            findata.Close();
            chat.Close();
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["User"] == null)
            {
                Response.Redirect("Login.aspx");
            }
            else
            {
                id = Request.QueryString.Get("id");
                Dataservice.DatamanagementClient findata = new Dataservice.DatamanagementClient();
                Chatmanagement.ChatClient        chat    = new Chatmanagement.ChatClient();
                UserData user = (UserData)Session["User"];
                if (!IsPostBack)
                {
                    Title = "Issue Chat";
                }

                findata.Open();
                chat.Open();



                issuedetails        = findata.getissuedetails(id);
                projdetails         = findata.getprojectdetails((string)issuedetails[3]);
                lblidname.InnerHtml = "Project : " + (string)projdetails[1] + " Issue : " + (string)issuedetails[1];
                chatdata            = chat.getissuechat(id);



                if (chatdata != null)
                {
                    for (int i = 0; i < chatdata.Length; i++)
                    {
                        if ((string)chatdata[i][0] == user.getID())
                        {
                            txtmsg.InnerText += Environment.NewLine;
                            txtmsg.InnerText += (string)chatdata[i][2] + "     ";
                            txtmsg.InnerText += Environment.NewLine;
                        }
                        else
                        {
                            txtmsg.InnerText += Environment.NewLine;
                            txtmsg.InnerText += "                                " + (string)chatdata[i][1].ToString().ToUpper();
                            txtmsg.InnerText += Environment.NewLine;
                            txtmsg.InnerText += "                                " + (string)chatdata[i][2];
                            txtmsg.InnerText += Environment.NewLine;
                        }
                    }
                }
                else
                {
                }



                findata.Close();
                chat.Close();
            }
        }
Ejemplo n.º 4
0
        protected void btnissedit_ServerClick(object sender, EventArgs e)
        {
            pid = Request.QueryString.Get("id");
            UserData user = (UserData)Session["User"];

            Dataservice.DatamanagementClient findata = new Dataservice.DatamanagementClient();
            Chatmanagement.ChatClient        chat    = new Chatmanagement.ChatClient();
            chat.Open();
            findata.Open();
            if (txtprojd.Value.Equals("") || txtprojt.Value.Equals(""))
            {
                projecteditdiv.InnerHtml += "*Please make sure you have filled in all the fields<br/>";
                return;
            }
            else
            {
                int result = findata.updateproject(txtprojt.Value, txtprojd.Value, pid);


                if (result == 1)
                {
                    foreach (ListItem item in Currentmembers.Items)
                    {
                        if (item.Selected)
                        {
                            int id = Convert.ToInt32(item.Value.ToString());
                            chat.deleteisschatuser(id.ToString());
                            findata.deleteassiguserformissue(id.ToString(), pid);
                        }
                    }
                    foreach (ListItem item in Othermembers.Items)
                    {
                        if (item.Selected)
                        {
                            int id = Convert.ToInt32(item.Value.ToString());
                            findata.insertissuenotifications(pid, id.ToString(), DateTime.Now);
                        }
                    }
                }
            }

            findata.Close();
            chat.Close();
            changePage();
        }
Ejemplo n.º 5
0
      protected void btnDeletefromteam_ServerClick(object sender, EventArgs e)
      {
          string   id   = Request.QueryString.Get("id");
          UserData user = (UserData)Session["User"];

          Dataservice.DatamanagementClient findata = new Dataservice.DatamanagementClient();
          Chatmanagement.ChatClient        chat    = new Chatmanagement.ChatClient();
          findata.Open();
          chat.Open();

          //chat.deleteisschatuser(user.getID());
          int result = findata.deleteassiguserformissue(user.getID(), id);


          findata.Close();
          chat.Close();

          if (result == 1)
          {
              Response.Redirect("Issues.aspx");
          }
      }
Ejemplo n.º 6
0
        protected void btnDeleteAcc_Click(object sender, EventArgs e)
        {
            user = (UserData)(Session["User"]);
            Userservice.UserserviceClient    service = new  Userservice.UserserviceClient();
            Dataservice.DatamanagementClient findata = new Dataservice.DatamanagementClient();
            Chatmanagement.ChatClient        chat    = new Chatmanagement.ChatClient();
            service.Open();
            findata.Open();
            chat.Open();

            Object[][] getuserprojects = findata.getprojects(user.getID());
            if (getuserprojects != null)
            {
                for (int j = 0; j < getuserprojects.Length; j++)
                {
                    string   pid            = (string)getuserprojects[j][0];
                    int      team           = findata.deleteprojteam(pid);
                    int      delete         = findata.deleteallprojnotificaion(pid);
                    int      deleteprojchat = chat.deleteprojchat(pid);
                    int      deltepissflags = findata.deleteissflagproj(pid);
                    object[] getmeetingid   = findata.getprojmeetings(pid);

                    if (getmeetingid != null)
                    {
                        for (int i = 0; i < getmeetingid.Length; i++)
                        {
                            int meetmemdel = findata.deletemeetingmembers((string)getmeetingid[i]);

                            if (meetmemdel == 1)
                            {
                                findata.deletemeeting((string)getmeetingid[i]);
                            }
                        }
                    }



                    object[][] getprojiss = findata.getprojissues(pid);

                    if (getprojiss != null)
                    {
                        for (int i = 0; i < getprojiss.Length; i++)
                        {
                            object[] issnotice = findata.getissnoticeiss((string)getprojiss[i][0]);
                            if (issnotice != null)
                            {
                                findata.deleteissnoticeiss((string)getprojiss[i][0]);
                            }
                            chat.deleteissuechat((string)getprojiss[i][0]);

                            findata.deleteissue((string)getprojiss[i][0]);
                        }
                    }


                    int proj = findata.deleteproject(pid);
                }
            }
            int projchat     = chat.deleteprojchatuser(user.getID());
            int isschat      = chat.deleteisschatuser(user.getID());
            int meetinglinks = findata.deleteuserfrommeetinglink(user.getID());
            int projteams    = findata.deleteuserfromprojteams(user.getID());
            int issteams     = findata.deleteuserfromissteams(user.getID());
            int issflag      = findata.deleteuserfromisflags(user.getID());
            int deletedvents = findata.deletealluserevents(user.getID());

            int deletetasks = findata.deleteallusertasks(user.getID());
            int deletepic   = findata.deleteallpictures(user.getID());


            int result = service.deleteUser(user.getID());

            if (result == 1)//if the result is one then the user is deleted and redirected to the index page
            {
                Session["User"] = null;
                //Response.Write("<script>alert('User Account Deleted!');</script>");
                Response.Redirect("Default.aspx");
            }

            service.Close();
            findata.Close();
            chat.Close();
        }
Ejemplo n.º 7
0
        protected void btnDeleteproject_ServerClick(object sender, EventArgs e)
        {
            Dataservice.DatamanagementClient findata = new Dataservice.DatamanagementClient();

            Chatmanagement.ChatClient chat = new Chatmanagement.ChatClient();
            UserData user = (UserData)Session["User"];

            findata.Open();
            chat.Open();

            int team           = findata.deleteprojteam(pid);
            int delete         = findata.deleteallprojnotificaion(pid);
            int deleteprojchat = chat.deleteprojchat(pid);
            int deltepissflags = findata.deleteissflagproj(pid);

            object[] getmeetingid = findata.getprojmeetings(pid);

            if (getmeetingid != null)
            {
                for (int i = 0; i < getmeetingid.Length; i++)
                {
                    int meetmemdel = findata.deletemeetingmembers((string)getmeetingid[i]);


                    findata.deletemeeting((string)getmeetingid[i]);
                }
            }



            object[][] getprojiss = findata.getprojissues(pid);

            if (getprojiss != null)
            {
                for (int i = 0; i < getprojiss.Length; i++)
                {
                    object[] issnotice = findata.getissnoticeiss((string)getprojiss[i][0]);
                    if (issnotice != null)
                    {
                        findata.deleteissnoticeiss((string)getprojiss[i][0]);
                    }
                    chat.deleteissuechat((string)getprojiss[i][0]);

                    findata.deleteissue((string)getprojiss[i][0]);
                }
            }


            int proj = findata.deleteproject(pid);

            if (proj == 1)
            {
                changePagedelete();
            }
            else
            {
                changePageerror();
            }



            chat.Close();
            findata.Close();
        }