Exemplo n.º 1
0
        private void meetings()
        {
            Dataservice.DatamanagementClient findata = new Dataservice.DatamanagementClient();
            findata.Open();
            UserData user = (UserData)Session["User"];

            Object[][] usermeetings = findata.getusermeetings(user.getID());

            if (usermeetings != null)
            {
                for (int j = 0; j < usermeetings.Length; j++)
                {
                    DateTime credate = DateTime.Parse((string)usermeetings[j][3]);



                    int result = DateTime.Compare(credate, DateTime.Now);

                    if (result < 0)
                    {
                        int deletemeetmembers = findata.deletemeetingmembers((string)usermeetings[j][0]);


                        findata.deletemeeting((string)usermeetings[j][0]);
                    }


                    Object[]   projectmembers = findata.getprojectmembers((string)usermeetings[j][4]);
                    object[][] meetingmembers = findata.getmeetingmembers((string)usermeetings[j][4]);

                    if (projectmembers != null)
                    {
                        if (meetingmembers != null)
                        {
                            for (int i = 0; i < projectmembers.Length; i++)
                            {
                                bool inmeeting = false;
                                for (int a = 0; a < meetingmembers.Length; a++)
                                {
                                    if ((string)projectmembers[i] == (string)meetingmembers[a][0])
                                    {
                                        inmeeting = true;
                                    }
                                }

                                if (inmeeting == false)
                                {
                                    findata.insertmeetingmember((string)usermeetings[j][0], (string)projectmembers[i], "0");
                                }
                            }
                        }
                        else
                        {
                            for (int i = 0; i < projectmembers.Length; i++)
                            {
                                findata.insertmeetingmember((string)usermeetings[j][0], (string)projectmembers[i], "0");
                            }
                        }
                    }
                }
            }



            findata.Close();
        }