Ejemplo n.º 1
0
        private DataTable GetUserInfo()
        {
            CRUD biz = new CRUD(DbVendor.Oracle, Runtime.OracleConnStrLocal, false);

            try
            {
                Clause c = new Clause();

                string sql = "";
                switch (this.req.data.logintype) //判断登录用户类型
                {
                case "S":
                    sql += "select * from " + M_Sys_Login_System.TableName + " where 1=1 ";
                    sql += " and trim(LoginName)='" + req.data.username + "'";
                    break;

                case "L":
                    sql += "select * from " + M_Sys_Login_Lease.TableName + " where 1=1 ";
                    sql += " and trim(LeaseNumber)='" + req.data.username + "'";
                    break;

                case "E":
                case "C":
                    c.Add("trim(LoginName)", req.data.username);
                    break;

                default:
                    throw new Exception("Unknown login type!");
                }
                DataTable dt = biz.RetrieveDataTable <Model.M_Sys_Login_Account>(c.Get());
                biz.Commit();
                return(dt);
            }
            catch (Exception err)
            {
                biz.Abort();
                throw err;
            }
        }