Exemplo n.º 1
0
 public List <CRONUSMetadata_Key> GetAllKeys()
 {
     using (db = new CRONUSContext())
     {
         return(db.CRONUSMetadata_Key.ToList());
     }
 }
Exemplo n.º 2
0
 public List <CRONUSMetadata_Index> GetAllIndexes()
 {
     using (db = new CRONUSContext())
     {
         return(db.CRONUSMetadata_Index.Where(i => i.Name.Contains("CRONUS")).ToList());
     }
 }
Exemplo n.º 3
0
 public List <CRONUS_Employees_Sick_2004> GetEmployeesSick2004()
 {
     using (db = new CRONUSContext())
     {
         return(db.CRONUS_Employees_Sick_2004.ToList());
     }
 }
Exemplo n.º 4
0
 public List <CRONUSMetadata_EmployeeRelated> GetEmployeesMetadataAndRelated()
 {
     using (db = new CRONUSContext())
     {
         return(db.CRONUSMetadata_EmployeeRelated.ToList());
     }
 }
Exemplo n.º 5
0
 public List <CRONUS_Sverige_AB_Partner> GetAllPartners()
 {
     using (db = new CRONUSContext())
     {
         return(db.CRONUS_Sverige_AB_Partner.ToList());
     }
 }
Exemplo n.º 6
0
 public List <CRONUS_Employees_And_Relatives> GetEmployeesAndRelatives()
 {
     using (db = new CRONUSContext())
     {
         return(db.CRONUS_Employees_And_Relatives.ToList());
     }
 }
Exemplo n.º 7
0
 public List <CRONUS_Employee_Top5_Absence> GetTop5EmployeesAbsent()
 {
     using (db = new CRONUSContext())
     {
         return(db.CRONUS_Employee_Top5_Absence.ToList());
     }
 }
Exemplo n.º 8
0
 public List <CRONUSMetadata_Column> GetAllColumnsInEmployees()
 {
     using (db = new CRONUSContext())
     {
         return(db.CRONUSMetadata_Column.Where(t => t.Table_Name.Equals("CRONUS Sverige AB$Employee")).ToList());
     }
 }
Exemplo n.º 9
0
 public List <CRONUSMetadata_Table> GetAllTablesInDB()
 {
     using (db = new CRONUSContext())
     {
         return(db.CRONUSMetadata_Table.ToList());
     }
 }
Exemplo n.º 10
0
 public List <CRONUSMetadata_Constraint> GetAllConstraints()
 {
     using (db = new CRONUSContext())
     {
         return(db.CRONUSMetadata_Constraint.ToList());
     }
 }
Exemplo n.º 11
0
        public List <CRONUS_Sverige_AB_Partner> GetAllEmployeesAndRelatives()
        {
            using (db = new CRONUSContext())
            {
                var queryResult = db.CRONUS_Sverige_AB_Employee.Join(db.CRONUS_Sverige_AB_Employee_Relative,
                                                                     e => e.No_,
                                                                     er => er.Employee_No_,
                                                                     (e, er) => new { CRONUS_Sverige_AB_Employee = e, CRONUS_Sverige_AB_Employee_Relative = er }).ToList();

                return(null);
            }
        }
Exemplo n.º 12
0
 public CRONUS_Sverige_AB_Partner RemovePartner(CRONUS_Sverige_AB_Partner partnerToRemove)
 {
     try
     {
         using (db = new CRONUSContext())
         {
             var partner = db.CRONUS_Sverige_AB_Partner.Where(p => p.Company == partnerToRemove.Company).SingleOrDefault();
             db.CRONUS_Sverige_AB_Partner.Remove(partner);
             db.SaveChanges();
             return(partnerToRemove);
         }
     } catch (Exception e)
     {
         throw e;
     }
 }
Exemplo n.º 13
0
        public CRONUS_Sverige_AB_Partner AddPartner(CRONUS_Sverige_AB_Partner newPartner)
        {
            try
            {
                using (db = new CRONUSContext())
                {
                    db.CRONUS_Sverige_AB_Partner.Add(newPartner);
                    db.SaveChanges();
                }
                return(newPartner);
            }catch (DbEntityValidationException e)
            {
                throw e;
            }

            catch (SqlException e)
            {
                throw e;
            }
            catch (Exception e)
            {
                throw e;
            }
        }