示例#1
0
        public Detail_RG_User GetDetail2(string LoginID)
        {
            Database db     = DatabaseFactory.CreateDatabase(DatabaseOperate.GetConnectionStringName("Messages_ConnectionString"));
            string   strSql = (db.DbProviderFactory.ToString() != "System.Data.OracleClient.OracleClientFactory") ?
                              "SELECT * FROM RG_User WHERE  LoginID=@LoginID " :
                              "SELECT * FROM RG_User WHERE  LoginID=:LoginID ";
            DbCommand cmd = db.GetSqlStringCommand(strSql);

            db.AddInParameter(cmd, "LoginID", DbType.String, LoginID);
            Detail_RG_User myDetail = new Detail_RG_User();

            using (IDataReader myReader = db.ExecuteReader(cmd))
            {
                if (myReader.Read())
                {
                    if (!Convert.IsDBNull(myReader["RowGuid"]))
                    {
                        myDetail.RowGuid = Convert.ToString(myReader["RowGuid"]);
                    }
                    if (!Convert.IsDBNull(myReader["DispName"]))
                    {
                        myDetail.DispName = Convert.ToString(myReader["DispName"]);
                    }
                    if (!Convert.IsDBNull(myReader["LoginID"]))
                    {
                        myDetail.LoginID = Convert.ToString(myReader["LoginID"]);
                    }
                    if (!Convert.IsDBNull(myReader["Mobile"]))
                    {
                        myDetail.Mobile = Convert.ToString(myReader["Mobile"]);
                    }
                    if (!Convert.IsDBNull(myReader["Sex"]))
                    {
                        myDetail.Sex = Convert.ToString(myReader["Sex"]);
                    }
                    if (!Convert.IsDBNull(myReader["OfficeTel"]))
                    {
                        myDetail.OfficeTel = Convert.ToString(myReader["OfficeTel"]);
                    }
                    if (!Convert.IsDBNull(myReader["DanWeiGuid"]))
                    {
                        myDetail.DWGuid = Convert.ToString(myReader["DanWeiGuid"]);
                    }
                    if (!Convert.IsDBNull(myReader["DanWeiGuid"]))
                    {
                        myDetail.DWName = Epoint.MisBizLogic2.DB.ExecuteToString("SELECT EnterpriseName FROM RG_OUInfo WHERE RowGuid='" + myReader["DanWeiGuid"] + "'");
                    }
                }
            }

            return(myDetail);
        }
示例#2
0
        public Detail_RG_User GetDetail2(string LoginID)
        {
            Database db = DatabaseFactory.CreateDatabase(DatabaseOperate.GetConnectionStringName("Messages_ConnectionString"));
            string strSql = (db.DbProviderFactory.ToString() != "System.Data.OracleClient.OracleClientFactory") ?
                "SELECT * FROM RG_User WHERE  LoginID=@LoginID " :
                "SELECT * FROM RG_User WHERE  LoginID=:LoginID ";
            DbCommand cmd = db.GetSqlStringCommand(strSql);

            db.AddInParameter(cmd, "LoginID", DbType.String, LoginID);
            Detail_RG_User myDetail = new Detail_RG_User();
            using (IDataReader myReader = db.ExecuteReader(cmd))
            {
                if (myReader.Read())
                {
                    if (!Convert.IsDBNull(myReader["RowGuid"]))
                    {
                        myDetail.RowGuid = Convert.ToString(myReader["RowGuid"]);
                    }
                    if (!Convert.IsDBNull(myReader["DispName"]))
                    {
                        myDetail.DispName = Convert.ToString(myReader["DispName"]);
                    }
                    if (!Convert.IsDBNull(myReader["LoginID"]))
                    {
                        myDetail.LoginID = Convert.ToString(myReader["LoginID"]);
                    }
                    if (!Convert.IsDBNull(myReader["Mobile"]))
                    {
                        myDetail.Mobile = Convert.ToString(myReader["Mobile"]);
                    }
                    if (!Convert.IsDBNull(myReader["Sex"]))
                    {
                        myDetail.Sex = Convert.ToString(myReader["Sex"]);
                    }
                    if (!Convert.IsDBNull(myReader["OfficeTel"]))
                    {
                        myDetail.OfficeTel = Convert.ToString(myReader["OfficeTel"]);
                    }
                    if (!Convert.IsDBNull(myReader["DanWeiGuid"]))
                    {
                        myDetail.DWGuid = Convert.ToString(myReader["DanWeiGuid"]);
                    }
                    if (!Convert.IsDBNull(myReader["DanWeiGuid"]))
                    {
                        myDetail.DWName = Epoint.MisBizLogic2.DB.ExecuteToString("SELECT EnterpriseName FROM RG_OUInfo WHERE RowGuid='" + myReader["DanWeiGuid"] + "'");
                    }
                }
            }

            return myDetail;
        }