Ejemplo n.º 1
0
    public PersonalRelationData getPersonalRelation(string personal_relation_code)
    {
        PersonalRelationData PersonalRelation_data = new PersonalRelationData();

        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle();

        oracleObj.SelectCommand = "Select * From Relation Where Relation_Code='" + personal_relation_code + "'";
        DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty);

        foreach (DataRowView rowData in allData)
        {
            PersonalRelation_data.PersonalRelation_Code = rowData["RELATION_CODE"].ToString();
            PersonalRelation_data.PersonalRelation_Thai = rowData["RELATION_THAI"].ToString();
            PersonalRelation_data.PersonalRelation_Eng  = rowData["RELATION_ENG"].ToString();
        }

        return(PersonalRelation_data);
    }
Ejemplo n.º 2
0
    public List <PersonalRelationData> getPersonalRelation()
    {
        List <PersonalRelationData> PersonalRelation_data = new List <PersonalRelationData>();

        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle();

        oracleObj.SelectCommand = "Select * From Relation Order By Relation_Code";
        DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty);

        foreach (DataRowView rowData in allData)
        {
            PersonalRelationData Relation = new PersonalRelationData();
            Relation.PersonalRelation_Code = rowData["RELATION_CODE"].ToString();
            Relation.PersonalRelation_Thai = rowData["RELATION_THAI"].ToString();
            Relation.PersonalRelation_Eng  = rowData["RELATION_ENG"].ToString();
            PersonalRelation_data.Add(Relation);
        }

        return(PersonalRelation_data);
    }