Beispiel #1
0
        public void deleteEquipmentClass(int id)
        {
            DBHelper._EquipmentClass dbhelp = new DBHelper._EquipmentClass();
            EquipmentClass           existingEquipmentClass = dbhelp.GetByid(id);

            dbhelp.Delete(existingEquipmentClass);
        }
Beispiel #2
0
        public void addEquipmentClass(Add equipmentClass)
        {
            DBHelper._EquipmentClass dbhelp = new DBHelper._EquipmentClass();
            var newEquipmentClass           = new EquipmentClass()
            {
                CompanyId   = equipmentClass.CompanyId,
                Name        = equipmentClass.Name,
                Description = equipmentClass.Description,
            };

            dbhelp.Add(newEquipmentClass);
        }
Beispiel #3
0
        public List <Detail> GetAllEquipmentClassBySuperAdmin()
        {
            DBHelper._EquipmentClass dbhelp = new DBHelper._EquipmentClass();

            return(dbhelp.GetAllBySuperAdmin().Select(s => new Detail()
            {
                Id = s.Id,
                CompanyId = s.CompanyId,
                CompanyName = s.Company.Name,
                Name = s.Name,
                Description = s.Description,
                DeletedFlag = s.DeletedFlag
            }).ToList <Detail>());
        }
Beispiel #4
0
        public Detail getEquipmentClassById(int id)
        {
            DBHelper._EquipmentClass dbhelp         = new DBHelper._EquipmentClass();
            EquipmentClass           equipmentClass = dbhelp.GetByid(id);

            return(new Detail()
            {
                Id = equipmentClass.Id,
                CompanyId = equipmentClass.CompanyId,
                CompanyName = equipmentClass.Company.Name,
                Name = equipmentClass.Name,
                Description = equipmentClass.Description,
                DeletedFlag = equipmentClass.DeletedFlag
            });
        }
Beispiel #5
0
        public void updateEquipmentClass(int id, Update equipmentClass)
        {
            DBHelper._EquipmentClass dbhelp = new DBHelper._EquipmentClass();
            EquipmentClass           existingEquipmentClass = dbhelp.GetByid(id);

            existingEquipmentClass.CompanyId   = equipmentClass.CompanyId;
            existingEquipmentClass.Name        = equipmentClass.Name;
            existingEquipmentClass.Description = equipmentClass.Description;
            if (equipmentClass.DeletedFlag.HasValue)
            {
                existingEquipmentClass.DeletedFlag = (bool)equipmentClass.DeletedFlag;
            }

            dbhelp.Update(existingEquipmentClass);
        }