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(); //} }
public List <FileType> GetFileType() { DeadlineManagementContext context = new DeadlineManagementContext(); using (context) { return((from a in context.filetypes select a).ToList()); } }
//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()); } }
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()); }
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()); }
public bool AddNewFile(FileUploaded f) { DeadlineManagementContext context = new DeadlineManagementContext(); using (context) { using (context) { context.fileuploades.Add(f); context.SaveChanges(); return(true); } } }