/// <summary> /// 得到一个对象实体 /// </summary> public LoginUser GetLoginUser(string USERID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select "); strSql.Append("USERID,USERNAME,EMAIL,PASSWORD,IsEnable "); strSql.Append(" from LOGINUSER "); strSql.Append(" where USERID='" + USERID + "'"); CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql); try { LoginUser lu = new LoginUser(); DataSet ds = new DataSet(); ds = pComm.ExeForDst(strSql.ToString());//执行Sql语句返回DataSet pComm.Close(); if (ds.Tables[0].Rows.Count > 0) { lu.USERID = ds.Tables[0].Rows[0]["USERID"].ToString(); lu.USERNAME = ds.Tables[0].Rows[0]["USERNAME"].ToString(); lu.EMAIL = ds.Tables[0].Rows[0]["EMAIL"].ToString(); lu.PASSWORD = ds.Tables[0].Rows[0]["PASSWORD"].ToString(); lu.IsEnable = int.Parse(ds.Tables[0].Rows[0]["IsEnable"].ToString()); } return(lu); } catch (System.Exception e) { pComm.Close(); throw e; } }
/// <summary> /// 得到一个对象实体 /// </summary> public UserRight GetUserRight(string UserID) { CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql); try { StringBuilder strSql = new StringBuilder(); strSql.Append("select "); strSql.Append("UserID,ckdmxb,ckdhzb,dbdgl,dbdxz,dbzsh,cccx,cksfmxb,bmsfmxb,sfchzb,sflxhzb,lkdgl,chmxz,kcpd,kcpdxz,kcpdsh,hp,ck,kh,gys,yg,bm,lkdxz,yhgl,qxgl,lkdsh,lkdmxb,lkdhzb,ckdgl,ckdxz,ckdsh "); strSql.Append(" from UserRight "); strSql.Append(" where UserID='" + UserID + "'"); UserRight UserRight = new UserRight(); DataSet ds = new DataSet(); ds = pComm.ExeForDst(strSql.ToString()); pComm.Close(); if (ds.Tables[0].Rows.Count > 0) { UserRight.UserID = ds.Tables[0].Rows[0]["UserID"].ToString(); UserRight.ckdmxb = ds.Tables[0].Rows[0]["ckdmxb"].ToString(); UserRight.ckdhzb = ds.Tables[0].Rows[0]["ckdhzb"].ToString(); UserRight.dbdgl = ds.Tables[0].Rows[0]["dbdgl"].ToString(); UserRight.dbdxz = ds.Tables[0].Rows[0]["dbdxz"].ToString(); UserRight.dbzsh = ds.Tables[0].Rows[0]["dbzsh"].ToString(); UserRight.cccx = ds.Tables[0].Rows[0]["cccx"].ToString(); UserRight.cksfmxb = ds.Tables[0].Rows[0]["cksfmxb"].ToString(); UserRight.bmsfmxb = ds.Tables[0].Rows[0]["bmsfmxb"].ToString(); UserRight.sfchzb = ds.Tables[0].Rows[0]["sfchzb"].ToString(); UserRight.sflxhzb = ds.Tables[0].Rows[0]["sflxhzb"].ToString(); UserRight.lkdgl = ds.Tables[0].Rows[0]["lkdgl"].ToString(); UserRight.chmxz = ds.Tables[0].Rows[0]["chmxz"].ToString(); UserRight.kcpd = ds.Tables[0].Rows[0]["kcpd"].ToString(); UserRight.kcpdxz = ds.Tables[0].Rows[0]["kcpdxz"].ToString(); UserRight.kcpdsh = ds.Tables[0].Rows[0]["kcpdsh"].ToString(); UserRight.hp = ds.Tables[0].Rows[0]["hp"].ToString(); UserRight.ck = ds.Tables[0].Rows[0]["ck"].ToString(); UserRight.kh = ds.Tables[0].Rows[0]["kh"].ToString(); UserRight.gys = ds.Tables[0].Rows[0]["gys"].ToString(); UserRight.yg = ds.Tables[0].Rows[0]["yg"].ToString(); UserRight.bm = ds.Tables[0].Rows[0]["bm"].ToString(); UserRight.lkdxz = ds.Tables[0].Rows[0]["lkdxz"].ToString(); UserRight.yhgl = ds.Tables[0].Rows[0]["yhgl"].ToString(); UserRight.qxgl = ds.Tables[0].Rows[0]["qxgl"].ToString(); UserRight.lkdsh = ds.Tables[0].Rows[0]["lkdsh"].ToString(); UserRight.lkdmxb = ds.Tables[0].Rows[0]["lkdmxb"].ToString(); UserRight.lkdhzb = ds.Tables[0].Rows[0]["lkdhzb"].ToString(); UserRight.ckdgl = ds.Tables[0].Rows[0]["ckdgl"].ToString(); UserRight.ckdxz = ds.Tables[0].Rows[0]["ckdxz"].ToString(); UserRight.ckdsh = ds.Tables[0].Rows[0]["ckdsh"].ToString(); } return(UserRight); } catch (Exception e) { pComm.Close(); throw e; } }
/// <summary> /// 得到一个对象实体 /// </summary> public FileData GetFileData(string FileGuID) { FileData FileData = new FileData(); StringBuilder strSql = new StringBuilder(); strSql.Append("select "); strSql.Append("FileGuID,FileID,FileName,FileType,ProductName,PublishDate,VersionID,WriteDept,ControlType,IsEnable,Remark,CreateGuid,CreateDate "); strSql.Append(" from FileData "); strSql.Append(" where FileGuID='" + FileGuID + "' "); CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql); DataSet ds = pComm.ExeForDst(strSql.ToString()); if (ds.Tables[0].Rows.Count > 0) { FileData.FileGuID = ds.Tables[0].Rows[0]["FileGuID"].ToString(); FileData.FileID = ds.Tables[0].Rows[0]["FileID"].ToString(); FileData.FileName = ds.Tables[0].Rows[0]["FileName"].ToString(); FileData.FileType = ds.Tables[0].Rows[0]["FileType"].ToString(); FileData.ProductName = ds.Tables[0].Rows[0]["ProductName"].ToString(); if (ds.Tables[0].Rows[0]["PublishDate"].ToString() != "") { FileData.PublishDate = DateTime.Parse(ds.Tables[0].Rows[0]["PublishDate"].ToString()); } FileData.VersionID = ds.Tables[0].Rows[0]["VersionID"].ToString(); FileData.IsEnable = int.Parse(ds.Tables[0].Rows[0]["IsEnable"].ToString()); FileData.WriteDept = ds.Tables[0].Rows[0]["WriteDept"].ToString(); FileData.ControlType = ds.Tables[0].Rows[0]["ControlType"].ToString(); FileData.Remark = ds.Tables[0].Rows[0]["Remark"].ToString(); FileData.CreateGuid = ds.Tables[0].Rows[0]["CreateGuid"].ToString(); if (ds.Tables[0].Rows[0]["CreateDate"].ToString() != "") { FileData.CreateDate = DateTime.Parse(ds.Tables[0].Rows[0]["CreateDate"].ToString()); } } return(FileData); }