public string GenerCaseWhenForOracle(string enName, string mTable, string key, string field, string enumKey, int def) { string sql = (string)Cash.GetObjFormApplication("ESQL" + enName + mTable + key + "_" + enumKey, null); // string sql = ""; if (sql != null) { return(sql); } if (this.Count == 0) { throw new Exception("@枚举值" + enumKey + "已被删除。"); } sql = " CASE NVL(" + mTable + field + "," + def + ")"; foreach (SysEnum se1 in this) { sql += " WHEN " + se1.IntKey + " THEN '" + se1.Lab + "'"; } SysEnum se = (SysEnum)this.GetEntityByKey(SysEnumAttr.IntKey, def); if (se == null) { sql += " END " + key + "Text"; } else { sql += " WHEN NULL THEN '" + se.Lab + "' END " + key + "TEXT"; } Cash.AddObj("ESQL" + enName + mTable + key + "_" + enumKey, Depositary.Application, sql); return(sql); }
public bool Full(string enumKey) { Entities ens = (Entities)Cash.GetObjFormApplication("EnumOf" + enumKey + Web.WebUser.SysLang, null); if (ens != null) { this.AddEntities(ens); return(true); } QueryObject qo = new QueryObject(this); qo.AddWhere(SysEnumAttr.EnumKey, enumKey); qo.addAnd(); qo.AddWhere(SysEnumAttr.Lang, Web.WebUser.SysLang); qo.addOrderBy(SysEnumAttr.IntKey); if (qo.DoQuery() == 0) { /* 看看xml配置里面是否有?*/ return(false); } Cash.AddObj("EnumOf" + enumKey + Web.WebUser.SysLang, Depositary.Application, this); return(true); }
/// <summary> /// 工作人员岗位s /// </summary> /// <param name="empId">empId</param> /// <returns>工作人员岗位s</returns> public Stations GetHisStations(string empId) { Stations ens = new Stations(); if (Cash.IsExits("EmpStationsOf" + empId, Depositary.Application)) { return((Stations)Cash.GetObjFormApplication("EmpStationsOf" + empId, null)); } else { QueryObject qo = new QueryObject(this); qo.AddWhere(EmpStationAttr.FK_Emp, empId); qo.addOrderBy(EmpStationAttr.FK_Station); qo.DoQuery(); foreach (EmpStation en in this) { ens.AddEntity(new Station(en.FK_Station)); } Cash.AddObj("EmpStationsOf" + empId, Depositary.Application, ens); return(ens); } }