/// <summary> /// add by xlg 2015-12-07 /// </summary> public static string GetUserImage(daoCommon dao, string strUserID) { //考勤系统头像目录 string AtPathDir = Application.StartupPath + "\\" + Common.AtPathDir + "\\"; var nullPath = AtPathDir + "01.png"; try { if (strUserID == "") { return nullPath; } var currPath = AtPathDir + strUserID + ".jpg"; if (!File.Exists(currPath)) { //add by xlg 2015-12-07 return strUserID; //end by xlg } else { if (!Program._dicCheckImage.ContainsKey(currPath)) { FileInfo tmpfile = new FileInfo(currPath); if (tmpfile.Length < 512) { File.Delete(currPath); return nullPath; } var tmpimage = Image.FromFile(currPath); Program._dicCheckImage.Add(currPath, tmpimage); } return currPath; } } catch (Exception ex) { return AtPathDir; //throw ex; } return AtPathDir; }
/// <summary> /// 根据编号获取name值 /// </summary> /// <param name="tablename">表名</param> /// <param name="NOCollom">编号列(包含值)</param> /// <param name="NameCollom">name列名</param> /// <returns></returns> public static string GetNameByNO(daoCommon dao, string tablename, StringDictionary NOCollom, string NameCollom) { string Collom = string.Empty; try { DataTable dt = dao.GetTableInfo(tablename, NOCollom, NOCollom, new StringDictionary(), ""); if (dt != null && dt.Rows.Count > 0) { Collom = dt.Rows[0][NameCollom].ToString(); } } catch (Exception ex) { throw ex; } return Collom; }
/// <summary> /// 取得用户头像 old /// </summary> public static string GetUserImageOld(daoCommon dao, string strUserID) { //考勤系统头像目录 string AtPathDir = Application.StartupPath + "\\" + Common.AtPathDir; try { if (strUserID == "") { AtPathDir = AtPathDir + "01.png"; //add by xlg 2015-12-07 return AtPathDir; } //ip是10.71开始:EmHttpIpRoom;ip是192.168开始:EmHttpIpWork; //string serverIp = Common.EmHttpIpRoom;//办公室 //string serverIp = Common.EmHttpIpWork;//车间 if (!File.Exists(AtPathDir + strUserID + ".jpg")) { //考勤系统人员头像文件不存在 //serverIp = "\\\\192.168.1.16"; ////int ret = NetworkSharedFolder.Connect(serverIp + "\\1", AtPathDir, "ISEC", "123"); //string server = serverIp + "\\1\\" + strUserID + ".jpg"; ////int ret = NetworkSharedFolder.Connect(serverIp + EmPathDir, AtPathDir, "administrator", "i3b4m6"); ////string server = serverIp + EmPathDir + strUserID + ".jpg"; //if (File.Exists(server)) ////if (true) //{//从人事系统复制头像到考勤系统:根据用户登录IP判断, // //DownLoadSoft(AtPathDir, server, strUserID + ".jpg"); // System.IO.File.Copy(server, AtPathDir + strUserID + ".jpg", true); // AtPathDir = AtPathDir + strUserID + ".jpg"; //} //else //{ // AtPathDir = AtPathDir + "01.png"; //} AtPathDir = AtPathDir + "01.png"; } else { AtPathDir = AtPathDir + strUserID + ".jpg"; } } catch (Exception ex) { throw ex; } return AtPathDir; }
public static DataTable GetProduceTeamTable(daoCommon dao, StringDictionary equalFieldsWithVal, StringDictionary likeFieldsWithVal) { return GetTable(dao, "Select * From P_Produce_Team", equalFieldsWithVal, likeFieldsWithVal, "id"); }
public static DataTable GetProduceLineTable(daoCommon dao, StringDictionary equalFieldsWithVal, StringDictionary likeFieldsWithVal) { return GetTable(dao, "Select DISTINCT LineID,LineName FROM V_Produce_Para_i", equalFieldsWithVal, likeFieldsWithVal, "LineName"); }
public static DataTable GetProduceProjectTable(daoCommon dao, StringDictionary equalFieldsWithVal, StringDictionary likeFieldsWithVal) { return GetTable(dao, "Select DISTINCT ProjectID,ProjectName From V_Produce_Para_i", equalFieldsWithVal, likeFieldsWithVal, "ProjectName"); }
public static DataTable GetTable(daoCommon dao, string sql, StringDictionary equalFieldsWithVal, StringDictionary likeFieldsWithVal,string afterOrderByString) { return dao.GetTableInfoBySql(sql, combine(equalFieldsWithVal, likeFieldsWithVal), equalFieldsWithVal, likeFieldsWithVal, afterOrderByString); }