Exemplo n.º 1
0
        public int GetFileDetail(int branch, int department)
        {
            DeadlineManagementContext context = new DeadlineManagementContext();

            using (context)
            {
                return(Convert.ToInt32((from sc in context.filetouploadeddetails
                                        .Include(x => x.department.branches)
                                        where sc.department.Id == department && sc.department.branches.Id == branch
                                        select sc.Id).FirstOrDefault()));
            }
            //public List<Branch> GetSubCategories(Branch c)
            //{
            //    DeadlineManagementContext context = new DeadlineManagementContext();
            //    using (context)

            //        return (from sc in context.branches
            //                            .Include(x => x.company)
            //                where sc.Id == c.Id
            //                select sc).ToList();

            //}
            //  public List<Branch> GetSubCategories(Branch c)
            //{
            //    DeadlineManagementContext context = new DeadlineManagementContext();
            //    using (context)

            //        return (from sc in context.branches
            //                            .Include(x => x.company)
            //                where sc.Id == c.Id
            //                select sc).ToList();

            //}
        }
Exemplo n.º 2
0
        public List <FileType> GetFileType()
        {
            DeadlineManagementContext context = new DeadlineManagementContext();

            using (context)
            {
                return((from a in context.filetypes select a).ToList());
            }
        }
Exemplo n.º 3
0
        //public List<Branch> GetSubBranches(Company c)
        //{
        //    DeadlineManagementContext context = new DeadlineManagementContext();
        //    u                                                                                                                                                                                                sing (context)

        //        return (from sc in context.branches
        //                            .Include(x => x.company)
        //                where sc.company.Id == c.Id
        //                select sc).ToList();

        //}

        public List <Branch> GetBranch()
        {
            DeadlineManagementContext context = new DeadlineManagementContext();

            using (context)
            {
                return((from a in context.branches select a).ToList());
            }
        }
Exemplo n.º 4
0
        public List <Department> GetDepartment(Branch c)
        {
            DeadlineManagementContext context = new DeadlineManagementContext();

            using (context)

                return((from sc in context.departments
                        .Include(x => x.branches)
                        where sc.Id == c.Id
                        select sc).ToList());
        }
Exemplo n.º 5
0
        public List <Branch> GetBranch(Company c)
        {
            DeadlineManagementContext context = new DeadlineManagementContext();

            using (context)

                return((from sc in context.branches
                        .Include(x => x.company)
                        where sc.Id == c.Id
                        select sc).ToList());
        }
Exemplo n.º 6
0
        public bool AddNewFile(FileUploaded f)
        {
            DeadlineManagementContext context = new DeadlineManagementContext();

            using (context)
            {
                using (context)
                {
                    context.fileuploades.Add(f);
                    context.SaveChanges();
                    return(true);
                }
            }
        }