Exemple #1
0
        public DetailCategory GetbyId(int id)
        {
            AssetDBContext db             = new AssetDBContext();
            var            detialCategory = db.DetailCategories.Include(c => c.SubCategory).FirstOrDefault(c => c.Id == id);

            return(detialCategory);
        }
        public Vendor GetById(int id)
        {
            AssetDBContext db      = new AssetDBContext();
            var            vendors = db.Vendors.FirstOrDefault(c => c.Id == id);

            return(vendors);
        }
        public GeneralCategory GetById(int id)
        {
            AssetDBContext db        = new AssetDBContext();
            var            gCategory = db.GeneralCategories.FirstOrDefault(c => c.Id == id);

            return(gCategory);
        }
Exemple #4
0
        public IList <Organization> GetAll()
        {
            AssetDBContext db            = new AssetDBContext();
            var            organizations = db.Organizations.ToList();

            return(organizations.ToList());
        }
        public IList <GeneralCategory> GetAll()
        {
            AssetDBContext db        = new AssetDBContext();
            var            gCategory = db.GeneralCategories.ToList();

            return(gCategory);
        }
Exemple #6
0
        public IList <Category> GetAll()
        {
            AssetDBContext db       = new AssetDBContext();
            var            category = db.Categories.Include(c => c.GeneralCategory).ToList();

            return(category);
        }
        public Location GetById(int id)
        {
            AssetDBContext db       = new AssetDBContext();
            var            location = db.Locations.Include(c => c.OrganizationBranch).FirstOrDefault(c => c.Id == id);

            return(location);
        }
 public bool Add(Department department)
 {
     AssetDBContext db = new AssetDBContext();
     db.Departments.Add(department);
     int rowAffected = db.SaveChanges();
     return rowAffected > 0;
 }
        public IList <Vendor> GetAll()
        {
            AssetDBContext db      = new AssetDBContext();
            var            vendors = db.Vendors.ToList();

            return(vendors);
        }
        public SubCategory GetById(int id)
        {
            AssetDBContext db          = new AssetDBContext();
            var            subCategory = db.SubCategories.Include(c => c.Category).FirstOrDefault(c => c.Id == id);

            return(subCategory);
        }
Exemple #11
0
        public IList <OrganizationBranch> GetAll()
        {
            AssetDBContext db = new AssetDBContext();
            var            organizationBranches = db.OrganizationBranches.Include(c => c.Organization).ToList();

            return(organizationBranches);
        }
        public IList <Employee> GetAll()
        {
            AssetDBContext db       = new AssetDBContext();
            var            employee = db.Employees.Include(c => c.OrganizationBranch).ToList();

            return(employee);
        }
        public IList <SubCategory> GetAll()
        {
            AssetDBContext db          = new AssetDBContext();
            var            subCategory = db.SubCategories.Include(c => c.Category).ToList();

            return(subCategory);
        }
        public IList <Location> GetAll()
        {
            AssetDBContext db       = new AssetDBContext();
            var            location = db.Locations.Include(c => c.OrganizationBranch).ToList();

            return(location);
        }
Exemple #15
0
        public Category GetbyId(int id)
        {
            AssetDBContext db       = new AssetDBContext();
            var            category = db.Categories.Include(c => c.GeneralCategory).FirstOrDefault(c => c.Id == id);

            return(category);
        }
        public Employee GetById(int id)
        {
            AssetDBContext db       = new AssetDBContext();
            var            employee = db.Employees.Include(c => c.OrganizationBranch).FirstOrDefault(c => c.Id == id);

            return(employee);
        }
Exemple #17
0
        public IList <DetailCategory> GetAll()
        {
            AssetDBContext db             = new AssetDBContext();
            var            detialCategory = db.DetailCategories.Include(c => c.SubCategory).ToList();

            return(detialCategory);
        }
Exemple #18
0
        public OrganizationBranch GetById(int id)
        {
            AssetDBContext db = new AssetDBContext();
            var            organizationBranch = db.OrganizationBranches.Include(c => c.Organization)
                                                .FirstOrDefault(c => c.Id == id);

            return(organizationBranch);
        }
Exemple #19
0
        public Organization GetById(int id)
        {
            AssetDBContext db = new AssetDBContext();

            var organization = db.Organizations.FirstOrDefault(c => c.Id == id);

            return(organization);
        }
 public bool Update(Department  department)
 {
     AssetDBContext db = new AssetDBContext();
     db.Departments.Attach(department);
     db.Entry(department).State = EntityState.Modified;
     int rowAffected = db.SaveChanges();
     return rowAffected > 0;
 }
        public bool Add(Employee employee)
        {
            AssetDBContext db = new AssetDBContext();

            db.Employees.Add(employee);
            int rowAffected = db.SaveChanges();

            return(rowAffected > 0);
        }
        public bool Add(GeneralCategory generalCategory)
        {
            AssetDBContext db = new AssetDBContext();

            db.GeneralCategories.Add(generalCategory);
            int rowAffected = db.SaveChanges();

            return(rowAffected > 0);
        }
Exemple #23
0
        public ActionResult Entry(OrganizationBranch organizationBranch)
        {
            AssetDBContext context = new AssetDBContext();

            context.OrganizationBranches.Add(organizationBranch);
            int rowAffected = context.SaveChanges();

            return(RedirectToAction("Entry"));
        }
        public bool Add(Location location)
        {
            AssetDBContext db = new AssetDBContext();

            db.Locations.Add(location);
            int rowAffected = db.SaveChanges();

            return(rowAffected > 0);
        }
Exemple #25
0
        public bool Add(Category category)
        {
            AssetDBContext db = new AssetDBContext();

            db.Categories.Add(category);
            int rowAffected = db.SaveChanges();

            return(rowAffected > 0);
        }
        public bool Add(Vendor vendor)
        {
            AssetDBContext db = new AssetDBContext();

            db.Vendors.Add(vendor);
            int rowAffected = db.SaveChanges();

            return(rowAffected > 0);
        }
Exemple #27
0
        public bool Add(OrganizationBranch organizationBranch)
        {
            AssetDBContext db = new AssetDBContext();

            db.OrganizationBranches.Add(organizationBranch);
            int rowAffacted = db.SaveChanges();

            return(rowAffacted > 0);
        }
Exemple #28
0
        public bool Update(Category category)
        {
            AssetDBContext db = new AssetDBContext();

            db.Categories.Attach(category);
            db.Entry(category).State = EntityState.Modified;
            int rowAffacted = db.SaveChanges();

            return(rowAffacted > 0);
        }
        public bool Update(Vendor vendor)
        {
            AssetDBContext db = new AssetDBContext();

            db.Vendors.Attach(vendor);
            db.Entry(vendor).State = EntityState.Modified;
            int rowAffacted = db.SaveChanges();

            return(rowAffacted > 0);
        }
        public bool Update(Employee employee)
        {
            AssetDBContext db = new AssetDBContext();

            db.Employees.Attach(employee);
            db.Entry(employee).State = EntityState.Modified;
            int rowAffected = db.SaveChanges();

            return(rowAffected > 0);
        }