Ejemplo n.º 1
0
 public void SetCriteria(QueryCriteria aCriteria)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 2
0
 private static string searchTable(QueryCriteria cirteria)
 {
     string search = @"select [Table].Id, Location, [Table].Name, SeatAmount, Status , TableType.Name as Type
                                from [Table], TableType
                                where   and [Table].TableTypeId = TableType.Id";
     if (cirteria != null)
     {
         search = search + " and " + cirteria.Name + " " + cirteria.Value;
     }
     return search;
 }
 public List<Table> QueryTableList(QueryCriteria condition)
 {
     FrontDeskRequest frontdesk = FrontDeskRequestControl.GetService(callBackId);
     try
     {
         return TableDao.GetTable(condition);
     }
     catch (HCSMSException ex)
     {
         raiseError(ex);
         if (frontdesk != null)
         {
            frontdesk.ErrorMessage(new ErrorEventArgs("", ex));
         }
         return null;
     }
     catch (Exception ex)
     {
         raiseError(ex);
         return null;
     }
 }
Ejemplo n.º 4
0
        public static List<Table> GetTable(QueryCriteria cirteria)
        {
            using (SqlConnection conn = Utilities.GetConnection())
            {
                SqlCommand comm = new SqlCommand(searchTable(cirteria), conn);

                try
                {
                    conn.Open();
                    List<Table> tableList = new List<Table>();
                    SqlDataReader reader = comm.ExecuteReader();

                    while (reader.Read())
                    {
                        tableList.Add(convertToTable(reader["ID"].ToString(), reader["Location"].ToString(), reader["Name"].ToString(), reader.GetInt32(3), reader["Status"].ToString(), reader["Type"].ToString()));
                    }
                    return tableList;
                }
                catch (SqlException sqlException)
                {
                    throw new HCSMSException(sqlException.Message);
                }
                finally
                {
                    if (conn != null)
                    {
                        conn.Close();
                    }
                }
            }
        }
        public List<SaleItem> QueryItemList(QueryCriteria queryConditon)
        {
            FrontDeskRequest frontdesk = FrontDeskRequestControl.GetService(callBackId);
            try
            {
                HCSMSLog.OnWarningLog(this, new NotifyEventArgs("Query ItemList Request"));
                return ItemDao.GetSaleItemByCondition(queryConditon);

            }
            catch (HCSMSException ex)
            {
                raiseError(ex);
                if (frontdesk != null)
                {
                   frontdesk.ErrorMessage(new ErrorEventArgs("", ex));
                }
                return null;
            }
            catch (Exception ex)
            {
                raiseError(ex);
                return null;
            }
        }