/// <summary>
 /// 往公司职务表中插入数据
 /// </summary>
 /// <param name="info"></param>
 /// <returns>插入数据后的对象</returns>
 public static bool insertEmployeePerformance(employeePerformance info)
 {
     try
     {
         using (employeeInfoSystemEntities db = new employeeInfoSystemEntities())
         {
             db.employeePerformance.Add(info);
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
 /// <summary>
 /// 往公司职务表中插入数据
 /// </summary>
 /// <param name="info"></param>
 /// <returns>插入数据后的对象</returns>
 public static bool insertCompanyPosition(companyPosition info)
 {
     try
     {
         using (employeeInfoSystemEntities db = new employeeInfoSystemEntities())
         {
             db.companyPosition.Add(info);
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
 /// <summary>
 /// 往公司部门表中插入数据
 /// </summary>
 /// <param name="info"></param>
 /// <returns>插入数据后的对象</returns>
 public static bool insertDepartment(department info)
 {
     try
     {
         using (employeeInfoSystemEntities db = new employeeInfoSystemEntities())
         {
             db.department.Add(info);
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
示例#4
0
 /// <summary>
 /// 查找公司就职信息
 /// </summary>
 /// <typeparam name="TKey"></typeparam>
 /// <param name="whereLambda"></param>
 /// <param name="orderBy"></param>
 /// <returns></returns>
 public static employeePerformance[] selectEmployeePerformance <TKey>(Expression <Func <employeePerformance, bool> > whereLambda, Expression <Func <employeePerformance, TKey> > orderBy)
 {
     try
     {
         using (employeeInfoSystemEntities db = new employeeInfoSystemEntities())
         {
             DbQuery <employeePerformance> dataObject = db.employeePerformance.Where(whereLambda).OrderBy(orderBy) as DbQuery <employeePerformance>;
             employeePerformance[]         infoList   = dataObject.ToArray();
             return(infoList);
         }
     }
     catch
     {
         employeePerformance[] nullInfo = new employeePerformance[0];
         return(nullInfo);
     }
 }
示例#5
0
 /// <summary>
 /// 查找公司职务信息
 /// </summary>
 /// <typeparam name="TKey"></typeparam>
 /// <param name="whereLambda"></param>
 /// <param name="orderBy"></param>
 /// <returns></returns>
 public static companyPosition[] selectCompanyPosition <TKey>(Expression <Func <companyPosition, bool> > whereLambda, Expression <Func <companyPosition, TKey> > orderBy)
 {
     try
     {
         using (employeeInfoSystemEntities db = new employeeInfoSystemEntities())
         {
             DbQuery <companyPosition> dataObject = db.companyPosition.Where(whereLambda).OrderBy(orderBy) as DbQuery <companyPosition>;
             companyPosition[]         infoList   = dataObject.ToArray();
             return(infoList);
         }
     }
     catch
     {
         companyPosition[] nullInfo = new companyPosition[0];
         return(nullInfo);
     }
 }
示例#6
0
 /// <summary>
 /// 查找公司部门信息
 /// </summary>
 /// <typeparam name="TKey"></typeparam>
 /// <param name="whereLambda"></param>
 /// <param name="orderBy"></param>
 /// <returns></returns>
 public static department[] selectDepartment <TKey>(Expression <Func <department, bool> > whereLambda, Expression <Func <department, TKey> > orderBy)
 {
     try
     {
         using (employeeInfoSystemEntities db = new employeeInfoSystemEntities())
         {
             DbQuery <department> dataObject = db.department.Where(whereLambda).OrderBy(orderBy) as DbQuery <department>;
             department[]         infoList   = dataObject.ToArray();
             return(infoList);
         }
     }
     catch
     {
         department[] nullInfo = new department[0];
         return(nullInfo);
     }
 }
 /// <summary>
 /// 修改department表的数据
 /// </summary>
 /// <param name="whereLambda"></param>
 /// <param name="info"></param>
 /// <returns></returns>
 public static bool updateDepartment(Expression <Func <department, bool> > whereLambda, department info)
 {
     try
     {
         using (employeeInfoSystemEntities db = new employeeInfoSystemEntities())
         {
             DbQuery <department> dataObject = db.department.Where(whereLambda) as DbQuery <department>;
             department           oldInfo    = dataObject.FirstOrDefault();
             oldInfo.departmentName = info.departmentName;
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
 /// <summary>
 ///删除公司职务表中符合的数据
 /// </summary>
 /// <param name="whereLambda"></param>
 /// <returns></returns>
 public static bool deleteEmployeePerformance(Expression <Func <employeePerformance, bool> > whereLambda)
 {
     try
     {
         using (employeeInfoSystemEntities db = new employeeInfoSystemEntities())
         {
             DbQuery <employeePerformance> dbDelete = db.employeePerformance.Where(whereLambda) as DbQuery <employeePerformance>;
             List <employeePerformance>    obDelete = dbDelete.ToList();
             db.employeePerformance.RemoveRange(obDelete);
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
 /// <summary>
 ///删除公司职务表中符合的数据
 /// </summary>
 /// <param name="whereLambda"></param>
 /// <returns></returns>
 public static bool deleteCompanyPosition(Expression <Func <companyPosition, bool> > whereLambda)
 {
     try
     {
         using (employeeInfoSystemEntities db = new employeeInfoSystemEntities())
         {
             DbQuery <companyPosition> dbDelete = db.companyPosition.Where(whereLambda) as DbQuery <companyPosition>;
             List <companyPosition>    obDelete = dbDelete.ToList();
             db.companyPosition.RemoveRange(obDelete);
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
示例#10
0
 /// <summary>
 ///删除公司部门表中符合的数据
 /// </summary>
 /// <param name="whereLambda"></param>
 /// <returns></returns>
 public static bool deleteDepartment(Expression <Func <department, bool> > whereLambda)
 {
     try
     {
         using (employeeInfoSystemEntities db = new employeeInfoSystemEntities())
         {
             DbQuery <department> dbDelete = db.department.Where(whereLambda) as DbQuery <department>;
             List <department>    obDelete = dbDelete.ToList();
             db.department.RemoveRange(obDelete);
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
示例#11
0
 /// <summary>
 /// 修改employeePerformance表的数据
 /// </summary>
 /// <param name="whereLambda"></param>
 /// <param name="info"></param>
 /// <returns></returns>
 public static bool updateEmployeePerformance(Expression <Func <employeePerformance, bool> > whereLambda, employeePerformance info)
 {
     try
     {
         using (employeeInfoSystemEntities db = new employeeInfoSystemEntities())
         {
             DbQuery <employeePerformance> dataObject = db.employeePerformance.Where(whereLambda) as DbQuery <employeePerformance>;
             employeePerformance           oldInfo    = dataObject.FirstOrDefault();
             oldInfo.positionId  = info.positionId;
             oldInfo.performance = info.performance;
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
示例#12
0
 /// <summary>
 /// 修改companyPosition表的数据
 /// </summary>
 /// <param name="whereLambda"></param>
 /// <param name="info"></param>
 /// <returns></returns>
 public static bool updateCompanyPosition(Expression <Func <companyPosition, bool> > whereLambda, companyPosition info)
 {
     try
     {
         using (employeeInfoSystemEntities db = new employeeInfoSystemEntities())
         {
             DbQuery <companyPosition> dataObject = db.companyPosition.Where(whereLambda) as DbQuery <companyPosition>;
             companyPosition           oldInfo    = dataObject.FirstOrDefault();
             oldInfo.departmentId   = info.departmentId;
             oldInfo.positionName   = info.positionName;
             oldInfo.positionSalary = info.positionSalary;
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
示例#13
0
 /// <summary>
 /// 修改employeeInfo表的数据
 /// </summary>
 /// <param name="whereLambda"></param>
 /// <param name="info"></param>
 /// <returns></returns>
 public static bool updateEmployeeInfo(Expression <Func <employeeInfo, bool> > whereLambda, employeeInfo info)
 {
     try
     {
         using (employeeInfoSystemEntities db = new employeeInfoSystemEntities())
         {
             DbQuery <employeeInfo> dataObject = db.employeeInfo.Where(whereLambda) as DbQuery <employeeInfo>;
             employeeInfo           oldInfo    = dataObject.FirstOrDefault();
             oldInfo.employeeName     = info.employeeName;
             oldInfo.employeeSex      = info.employeeSex;
             oldInfo.employeePhone    = info.employeePhone;
             oldInfo.employeeBir      = info.employeeBir;
             oldInfo.employeeIdentity = info.employeeIdentity;
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }