public StatPolar GetStatPolar(int year, int month) { try { StatPolar list = new StatPolar() { year = year, month = month }; string sql = "SELECT " + "count(distinct a.ordernumber) " + "FROM s_order as a " + "join s_order_details as b on a.id = b.orderID " + "where b.articleID != 0 " + "and a.id not in (" + "SELECT distinct a.id FROM s_order as a " + "join s_order_details as b on a.id = b.orderID " + "join magnalister_orders as c on a.id = c.orders_id " + "where b.articleID != 0 " + "and year(a.ordertime) = " + year.ToString() + " and month(a.ordertime) = " + month.ToString() + ")" + " and year(a.ordertime) = " + year.ToString() + " and month(a.ordertime) = " + month.ToString() + " group by year(a.ordertime),month(a.ordertime);"; MySqlCommand command = new MySqlCommand(sql, connection); MySqlDataReader reader = command.ExecuteReader(); while (reader.Read()) { list.shopware = int.Parse(reader[0].ToString()); } reader.Close(); CloseConnection(); return(list); } catch (Exception ex) { Console.WriteLine("Database: Unable to retrieve records () from the database."); CloseConnection(); return(null); } }
private static StatPolarItemViewModel Convert(StatPolar r) { return(new StatPolarItemViewModel(r)); }
public StatPolarItemViewModel(StatPolar model) { _item = model; }
public StatPolarItemViewModel() { _item = new StatPolar(); }