public IActionResult Completed()
        {
            var EntityID = Request.Cookies["ID"].ToString();
            UsersQueries ex = new UsersQueries();
            DataTable varUser = new DataTable();
            varUser = ex.ExecuteQueryFunction("Select * from App_Users Where ID = " + EntityID);
            var CategoryID = varUser.Rows[0][1].ToString();

            DataTable varCollab = new DataTable();
            varCollab = ex.ExecuteQueryFunction("Select ACL.ID, AC.FileDirectoryID as Audio,CT.Description as Category,SCT.Description as SubCategory,U.FirstName + ' ' + U.LastName as MasterOwner, AC.ShortDescription,(SELECT FirstName + ' ' + LastName as CollaboName  from App_Users  Where ID = ACL.LinkedUserID ) CollaboName, ACL.NewUpload as ResponseAudio  from [dbo].[App_Collaborations_Linked] ACL" +
                                                " LEFT JOIN[dbo].[App_Collaborations] AC ON AC.ID = ACL.CollaboID" +
                                                " LEFT JOIN Lk_SubCategoryTypes SCT ON SCT.ID = AC.SubCategoryID" +
                                                " Left Join Lk_CategoryTypes CT ON  CT.ID = AC.CategoryID" +
                                                " LEFT JOIN App_Users U ON U.ID = AC.UserID" +
                                                " Where AC.APPTypeID = " + CategoryID + " AND AC.UserID = " + EntityID + "  AND ACL.StatusID = 3 ");
            var varMessages = varCollab.Rows.Count;
            DataTable varCategories = new DataTable();
            varCategories = ex.ExecuteQueryFunction("Select Description from Lk_CategoryTypes Where APPID =  " + CategoryID);

            DataTable varPending = new DataTable();
            varPending = ex.ExecuteQueryFunction("Select Count(CollaboID) as Pending from [dbo].[App_Collaborations_Linked] Where LinkedUserID  = " + EntityID + " AND StatusID = 3");

            DataTable varSubCategories = new DataTable();
            varSubCategories = ex.ExecuteQueryFunction("Select Description from Lk_SubCategoryTypes Where APPID =  " + CategoryID);

            UserDetails userDetails = new UserDetails();
            Collaborations collabs = new Collaborations();

            userDetails = (from DataRow row in varUser.Rows
                           select new UserDetails
                           {
                               Name = row["FirstName"].ToString(),
                               LastName = row["LastName"].ToString(),
                               Credits = row["Credits"].ToString(),
                               Pending = varPending.Rows[0][0].ToString(),
                               Messages = varMessages.ToString(),
                               varCollaborations = (from DataRow row2 in varCollab.Rows
                                                    select new Collaborations
                                                    {
                                                        ID = Convert.ToInt32(row2["ID"].ToString()),
                                                        Category = row2["Category"].ToString(),
                                                        SubCategory = row2["SubCategory"].ToString(),
                                                        Name = row2["MasterOwner"].ToString(),
                                                        Audio = row2["Audio"].ToString(),
                                                        Description = row2["ShortDescription"].ToString(),
                                                        ResposeAudio = row2["ResponseAudio"].ToString(),
                                                    }).ToList(),
                               varCategory = (from DataRow row2 in varCategories.Rows
                                              select new Category
                                              {
                                                  Description = row2["Description"].ToString(),
                                              }).ToList(),
                               varSubCategory = (from DataRow row2 in varSubCategories.Rows
                                                 select new SubCategory
                                                 {
                                                     Description = row2["Description"].ToString(),
                                                 }).ToList(),
                           }).FirstOrDefault();
            return View(new List<UserDetails> { userDetails });
        }
Esempio n. 2
0
        public void Cancel()
        {
            IsCanceled = true;

            var notification = Notification.TeamupCanceled(this);

            foreach (var contributor in Collaborations.Select(c => c.Contributor))
                contributor.Notify(notification);

        }
Esempio n. 3
0
 /// <summary>
 /// Adds a new collaboration
 /// </summary>
 /// <param name="collaboration"></param>
 /// <returns></returns>
 private UMLCollaboration AddCollaboration(UMLCollaboration collaboration)
 {
     foreach (UMLCollaboration c in Collaborations)
     {
         if (collaboration.Name == c.Name && collaboration.Owner == c.Owner)
         {
             c.Files = collaboration.Files;
             return(c);
         }
     }
     Collaborations.Add(collaboration);
     return(collaboration);
 }
Esempio n. 4
0
        public void Modify(TeamupFormViewModel viewModel)
        {
            var notification = Notification.TeamupModified(this, DateTime, Address);

            Address = viewModel.Address;
            DateTime = viewModel.GetDateTime();
            Description = viewModel.Description;
            DevelopmentLanguageId = viewModel.DevelopmentLanguage;
            DevelopmentTypeId = viewModel.DevelopmentType;

            foreach (var contributor in Collaborations.Select(c => c.Contributor))
                contributor.Notify(notification);         
        }
Esempio n. 5
0
        public IActionResult UserCollaborations()
        {
            var          EntityID = Request.Cookies["ID"].ToString();
            UsersQueries ex       = new UsersQueries();
            DataTable    varUser  = new DataTable();

            varUser = ex.ExecuteQueryFunction("Select * from App_Users Where ID = " + EntityID);
            var CategoryID = varUser.Rows[0][1].ToString();

            DataTable varCollab = new DataTable();

            varCollab = ex.ExecuteQueryFunction("Select C.ID, CT.Description as Category,SC.Description as SubCategory,U.FirstName + ' ' + U.LastName as Name, C.FileDirectoryID as Audio,C.ShortDescription as Description  from App_Collaborations C " +
                                                "Left Join Lk_CategoryTypes CT ON  CT.ID = C.CategoryID" +
                                                " Left Join Lk_SubCategoryTypes SC ON SC.ID = C.SubCategoryID" +
                                                " LEFT JOIN App_Users U ON U.ID = C.UserID" +
                                                " Where C.APPTypeID = " + CategoryID + " AND UserID = " + EntityID + ";");

            UserDetails    userDetails = new UserDetails();
            Collaborations collabs     = new Collaborations();

            userDetails = (from DataRow row in varUser.Rows
                           select new UserDetails
            {
                Name = row["FirstName"].ToString(),
                LastName = row["LastName"].ToString(),
                Credits = row["Credits"].ToString(),
                varCollaborations = (from DataRow row2 in varCollab.Rows
                                     select new Collaborations
                {
                    ID = Convert.ToInt32(row2["ID"].ToString()),
                    Category = row2["Category"].ToString(),
                    SubCategory = row2["SubCategory"].ToString(),
                    Name = row2["Name"].ToString(),
                    Audio = row2["Audio"].ToString(),
                    Description = row2["Description"].ToString(),
                }).ToList(),
            }).FirstOrDefault();
            return(View(new List <UserDetails> {
                userDetails
            }));
        }
Esempio n. 6
0
        public IActionResult Create()
        {
            var          EntityID = Request.Cookies["ID"].ToString();
            UsersQueries ex       = new UsersQueries();
            DataTable    varUser  = new DataTable();

            varUser = ex.ExecuteQueryFunction("Select * from App_Users Where ID = " + EntityID);
            var CategoryID = varUser.Rows[0][1].ToString();

            DataTable Category = new DataTable();

            Category = ex.ExecuteQueryFunction("Select * from Lk_CategoryTypes Where APPID = " + CategoryID + ";");
            //var varCategoryID
            DataTable SubCategory = new DataTable();

            SubCategory = ex.ExecuteQueryFunction("Select * from Lk_SubCategoryTypes Where APPID = " + CategoryID + ";");
            Upload         UploadData = new Upload();
            Collaborations collabs    = new Collaborations();

            UploadData = (from DataRow row in varUser.Rows
                          select new Upload
            {
                Name = row["FirstName"].ToString(),
                LastName = row["LastName"].ToString(),
                Credits = row["Credits"].ToString(),
                varCategory = (from DataRow row2 in Category.Rows
                               select new Category
                {
                    Description = row2["Description"].ToString(),
                }).ToList(),
                varSubCategory = (from DataRow row2 in SubCategory.Rows
                                  select new SubCategory
                {
                    Description = row2["Description"].ToString(),
                }).ToList(),
            }).FirstOrDefault();

            return(View(new List <Upload> {
                UploadData
            }));
        }
        public IActionResult open(string ID)
        {
            UsersQueries ex = new UsersQueries();
            DataTable varCollab = new DataTable();
            varCollab = ex.ExecuteQueryFunction("Select ACL.ID, AC.FileDirectoryID as Audio,CT.Description as Category,SCT.Description as SubCategory,U.FirstName + ' ' + U.LastName as MasterOwner, AC.ShortDescription,(SELECT FirstName + ' ' + LastName as CollaboName  from App_Users  Where ID = ACL.LinkedUserID ) CollaboName, ACL.NewUpload as ResponseAudio  from [dbo].[App_Collaborations_Linked] ACL" +
                                                " LEFT JOIN[dbo].[App_Collaborations] AC ON AC.ID = ACL.CollaboID" +
                                                " LEFT JOIN Lk_SubCategoryTypes SCT ON SCT.ID = AC.SubCategoryID" +
                                                " Left Join Lk_CategoryTypes CT ON  CT.ID = AC.CategoryID" +
                                                " LEFT JOIN App_Users U ON U.ID = AC.UserID" +
                                                " Where ACL.ID = " + ID);
            Collaborations collabs = new Collaborations();
            foreach (DataRow row2 in varCollab.Rows)
            {
                collabs.ID = Convert.ToInt32(row2["ID"].ToString());
                collabs.Category = row2["Category"].ToString();
                collabs.SubCategory = row2["SubCategory"].ToString();
                collabs.Name = row2["MasterOwner"].ToString();
                collabs.Audio = row2["Audio"].ToString();
                collabs.Description = row2["ShortDescription"].ToString();
                collabs.ResposeAudio = row2["ResponseAudio"].ToString();
            }

            return View(collabs);
        }