private string FormatTextBySysDic(string strColValue, string strSysCategory) { string strTemp = string.Empty; decimal dValue = 0; decimal.TryParse(strColValue, out dValue); List <T_SYS_DICTIONARY> entDics = new List <T_SYS_DICTIONARY>();// permClient.GetSysDictionaryByCategory(strSysCategory); using (SysDictionaryBLL bll = new SysDictionaryBLL()) { //GetSysLeftMenuFilterPermissionToNewFrame("85b414ab-87b3-4740-aef4-1d89f3f380cc"); entDics = bll.GetSysDictionaryByCategory(strSysCategory).ToList(); } strTemp = entDics.Where(c => c.DICTIONARYVALUE == dValue).First().DICTIONARYNAME; strTemp = string.IsNullOrEmpty(strTemp) == true ? "-" : strTemp; return(strTemp); }
public List<T_SYS_DICTIONARY> GetSysDictionaryByCategoryList(List<string> category) { using (SysDictionaryBLL bll = new SysDictionaryBLL()) { List<T_SYS_DICTIONARY> dictlist = bll.GetSysDictionaryByCategory(category); return dictlist; } }
public List<T_SYS_DICTIONARY> GetSysDictionaryByCategory(string category) { using (SysDictionaryBLL bll = new SysDictionaryBLL()) { //GetSysLeftMenuFilterPermissionToNewFrame("85b414ab-87b3-4740-aef4-1d89f3f380cc"); IQueryable<T_SYS_DICTIONARY> dictlist = bll.GetSysDictionaryByCategory(category); return dictlist != null ? dictlist.ToList() : null; } }
private StringBuilder GetEmployeeAttendBody(string CompanyName, string Strdate, List <V_LEFTOFFICEVIEW> Collects) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("<body>\n\r"); stringBuilder.Append("<table ID=\"Table0\" BORDER=1 CELLSPACING=1 CELLPADDING=3 width=100% align=center>\n\r"); stringBuilder.Append("<tr>"); stringBuilder.Append("<table border=1 cellspacing=0 CELLPADDING=3 width=100% align=center>"); stringBuilder.Append("<tr>"); stringBuilder.Append("<td align=center class=\"title\" >员工编号</td>"); stringBuilder.Append("<td align=center class=\"title\" >员工姓名</td>"); stringBuilder.Append("<td align=center class=\"title\" >离职类型</td>"); stringBuilder.Append("<td align=center class=\"title\" >入职时间</td>"); stringBuilder.Append("<td align=center class=\"title\" >离职时间</td>"); stringBuilder.Append("<td align=center class=\"title\" >申请时间</td>"); stringBuilder.Append("<td align=center class=\"title\" >审批状态</td>"); stringBuilder.Append("<td align=center class=\"title\" >是否确认</td>"); stringBuilder.Append("</tr>"); if (Collects.Count <V_LEFTOFFICEVIEW>() > 0) { SysDictionaryBLL bll = new SysDictionaryBLL(); List <TM_SaaS_OA_EFModel.T_SYS_DICTIONARY> sysDictionaryByCategoryList = bll.GetSysDictionaryByCategory(new List <string> { "LEFTOFFICECATEGORY", "CHECKSTATE" }); int i; for (i = 0; i < Collects.Count; i++) { stringBuilder.Append("<tr>"); stringBuilder.Append("<td class=\"x1282\">" + Collects[i].EMPLOYEECODE + "</td>"); stringBuilder.Append("<td class=\"x1282\">" + Collects[i].EMPLOYEECNAME + "</td>"); stringBuilder.Append("<td class=\"x1282\">" + sysDictionaryByCategoryList.Where(t => t.DICTIONARYVALUE == Convert.ToInt32(Collects[i].LEFTOFFICECATEGORY) && t.DICTIONCATEGORY == "LEFTOFFICECATEGORY").FirstOrDefault().DICTIONARYNAME + "</td>"); stringBuilder.Append("<td class=\"x1282\">" + Collects[i].ENTRYDATE.Value.ToString("yyyy-MM-dd") + "</td>"); stringBuilder.Append("<td class=\"x1282\">" + Collects[i].LEFTOFFICEDATE.Value.ToString("yyyy-MM-dd") + "</td>"); stringBuilder.Append("<td class=\"x1282\">" + Collects[i].APPLYDATE.Value.ToString("yyyy-MM-dd") + "</td>"); stringBuilder.Append("<td class=\"x1282\">" + sysDictionaryByCategoryList.Where(t => t.DICTIONARYVALUE == decimal.Parse(Collects[i].CHECKSTATE) && t.DICTIONCATEGORY == "CHECKSTATE").FirstOrDefault().DICTIONARYNAME + "</td>"); int num = Convert.ToInt32(Collects[i].ISCONFIRMED); string str1 = string.Empty; if (num < 0) { str1 = "未确认"; } else { if (num >= 0 && num < 2) { str1 = "确认中"; } else { if (num == 2) { str1 = "已确认"; } else { if (num == 3) { str1 = "确认未通过"; } } } } stringBuilder.Append("<td class=\"x1282\">" + str1 + "</td>"); stringBuilder.Append("</tr>"); } } stringBuilder.Append("</table>"); stringBuilder.Append("</body></html>"); return(stringBuilder); }
/// <summary> /// 数据组装 /// </summary> /// <param name="dt"></param> /// <param name="entSignIn"></param> /// <returns></returns> private DataTable GetDataConversion(DataTable dt, IQueryable <T_HR_EMPLOYEESIGNINDETAIL> entSignIn) { dt.Rows.Clear(); foreach (var item in entSignIn) { try { List <T_SYS_DICTIONARY> dic = new List <T_SYS_DICTIONARY>();//new SaaS.BLLCommonServices.PermissionWS.PermissionServiceClient().GetSysDictionaryByCategoryList(new string[] { "ABNORMCATEGORY", "ATTENDPERIOD", "REASONCATEGORY" });//获取字典值 using (SysDictionaryBLL bll = new SysDictionaryBLL()) { dic = bll.GetSysDictionaryByCategory(new List <string> { "ABNORMCATEGORY", "ATTENDPERIOD", "REASONCATEGORY" }); } // nationDict = tmp.Where(s => s.DICTIONCATEGORY == "NATION" && s.DICTIONARYVALUE == nationValue).FirstOrDefault(); DataRow row = dt.NewRow(); #region 每行数据 for (int i = 0; i < dt.Columns.Count; i++) { switch (i) { case 0: row[i] = item.ABNORMALDATE.Value.ToString("yyyy-MM-dd"); break; //异常日期 case 1: decimal?abCategory = Convert.ToDecimal(item.ABNORMCATEGORY); var dicAbCategory = dic.Where(s => s.DICTIONCATEGORY == "ABNORMCATEGORY" && s.DICTIONARYVALUE == abCategory).FirstOrDefault(); if (dicAbCategory != null) { row[i] = dicAbCategory.DICTIONARYNAME;; //异常类型 } break; case 2: decimal?abOd = Convert.ToDecimal(item.ATTENDPERIOD); var dicAbOd = dic.Where(s => s.DICTIONCATEGORY == "ATTENDPERIOD" && s.DICTIONARYVALUE == abOd).FirstOrDefault(); if (dicAbOd != null) { row[i] = dicAbOd.DICTIONARYNAME; //异常时间段 } break; case 3: row[i] = item.ABNORMALTIME; break; //异常时长(分钟) case 4: decimal?reCategory = Convert.ToDecimal(item.REASONCATEGORY); var dicReCategory = dic.Where(s => s.DICTIONCATEGORY == "REASONCATEGORY" && s.DICTIONARYVALUE == reCategory).FirstOrDefault(); if (dicReCategory != null) { row[i] = dicReCategory.DICTIONARYNAME;; //异常原因类型 } break; case 5: row[i] = item.DETAILREASON; break; //异常原因 } } dt.Rows.Add(row); #endregion } catch (Exception ex) { SMT.Foundation.Log.Tracer.Debug("ExportEmployeeSignIn导出员工签卡信息组装DataTable时出错:" + ex.Message); return(null); } } return(dt); }