public List<EmployeeOR> selectEmployeeData(string orgbhWhere) { if (string.IsNullOrEmpty(orgbhWhere)) return null; string sql = @"select bu.* from t_Employee bu inner join t_Bank b on b.orgbh= bu.orgbh where " + orgbhWhere; DataTable dt = null; try { dt = dbMsSql.ExecuteQuery(sql); } catch (Exception ex) { throw ex; } if (dt == null) return null; List<EmployeeOR> listEmp = new List<EmployeeOR>(); foreach (DataRow dr in dt.Rows) { EmployeeOR obj = new EmployeeOR(dr); listEmp.Add(obj); } return listEmp; }
/// <summary> /// 获取插入数据 /// </summary> public string GetInsertSql(EmployeeOR employee) { string sql = @"insert into t_Employee (Id,Name,EmployNo,pwd,EmployType,HighRole, LowRole,Description,OrgBH) values ('@Id','@Name','@EmployNo','@pwd','@EmployType','@HighRole', '@LowRole','@Description','@OrgBH')"; sql = sql.Replace("@Id", employee.Id); // sql = sql.Replace("@Name", employee.Name); //姓名 sql = sql.Replace("@EmployNo", employee.Employno); //柜员编号 sql = sql.Replace("@pwd", employee.Pwd); //密码 sql = sql.Replace("@EmployType", employee.Employtype); //外键,关联到表t_EmployType中 sql = sql.Replace("@HighRole", employee.Highrole); //默认不设置,以窗口角色为准 外键,关联到表t_BussinessRole中。表示高柜业务角色 sql = sql.Replace("@LowRole", employee.Lowrole); //默认不设置,以窗口角色为准 外键,关联到表t_BussinessRole中。表示低柜业务角色 sql = sql.Replace("@Description", employee.Description); //描述 sql = sql.Replace("@OrgBH", employee.Orgbh); //机构编号 return sql; }
public List<BussinessRoleONOR> GetBussinessRoleOn(EmployeeOR empobj, WindowOR winobj) { string strRoleID = string.Empty; switch (DateTime.Now.DayOfWeek) { case DayOfWeek.Monday: strRoleID = winobj.Role; break; case DayOfWeek.Tuesday: strRoleID = winobj.Jca2; break; case DayOfWeek.Wednesday: strRoleID = winobj.Jca3; break; case DayOfWeek.Thursday: strRoleID = winobj.Jca4; break; case DayOfWeek.Friday: strRoleID = winobj.Jca5; break; case DayOfWeek.Saturday: strRoleID = winobj.Jca6; break; case DayOfWeek.Sunday: strRoleID = winobj.Jca7; break; } BussinessRoleOnBussOR windowRole = null; if (!string.IsNullOrEmpty(strRoleID)) { windowRole = GetBussinessRole(strRoleID); } BussinessRoleOnBussOR empRole = null; if (!string.IsNullOrEmpty(empobj.Highrole)) { empRole = GetBussinessRole(empobj.Highrole); } return CombinRole(windowRole, empRole); }