public SELLERS_VIEW Post([FromBody] Model claim) { Authentication authentication = new Authentication(); SELLERS user = authentication.AuthenticateSeller(claim.EMAIL, claim.PASSWORD); SELLERS_VIEW seller = new SELLERS_VIEW(); seller.EMAIL = user.EMAIL; seller.SELLERID = user.SELLERID; seller.SELLERNAME = user.SELLERNAME; return(seller); }
public static List <SELLERS_VIEW> GetAll() { SELLERS_VIEW seller = null; List <SELLERS_VIEW> sellers = new List <SELLERS_VIEW>(); try { using (OracleConnection con = new OracleConnection(conlink)) { if (con.State == ConnectionState.Closed) { con.Open(); } string query = "SELECT * FROM SELLERS_VIEW"; OracleCommand cmd = new OracleCommand(query, con); OracleDataReader reader = cmd.ExecuteReader(); if (reader != null) { if (reader.HasRows) { while (reader.Read()) { seller = new SELLERS_VIEW() { SELLERNAME = reader["SELLERNAME"].ToString(), EMAIL = reader["EMAIL"].ToString(), PASSWORD = reader["PASSWORD"].ToString() }; sellers.Add(seller); } reader.Close(); } } if (con.State == ConnectionState.Open) { con.Close(); } } } catch (Exception ex) { throw ex; } return(sellers); }