public static string checkevents() { mydb db = new mydb(); string st = "select event_id from tbl_events where event_date between dateadd(MINUTE,-1,GETDATE()) and dateadd(MINUTE,1,GETDATE()) and is_displayed = 0"; return(db.read_val(st)); }
public static string isClosed(string orderid) { mydb db = new mydb(); string st = ""; st = "select isClosed from tbl_orders where order_id=" + orderid; return(db.read_val(st)); }
/// <summary> /// Page Load Event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { st = "select top(1) image_url from tbl_themes where is_active = 1"; background = db.read_val(st); if (Request.Cookies["tableNumber"] != null) { st = "select order_id,amount from tbl_orders where tableNumber=" + Request.Cookies["tableNumber"].Value + " and isClosed=0"; SqlDataReader dr = db.readall(st); if (dr.Read()) { hf_orderid.Value = dr[0].ToString(); lnk_cart.Text = dr[1].ToString(); pnl_neworder.Visible = false; pnl_page.Visible = true; } else { ScriptManager.RegisterStartupScript(UpdatePanel3, UpdatePanel3.GetType(), "", "$('#processing-modal').modal('show');", true); pnl_neworder.Visible = true; pnl_page.Visible = false; } pnl_table.Visible = false; dr.Close(); } else { pnl_page.Visible = false; pnl_table.Visible = true; btn_neworder.Visible = false; } st = "select category_id,category_name from tbl_category where is_active=1"; db.fill_rptr_ret_sqlda(st, rpt_category); st = "SELECT [Combo_id],[title],[description],[price],[combo_picture] FROM [dbo].[tbl_combos]"; db.fill_rptr_ret_sqlda(st, rpt_combos); st = @"SELECT tbl_player.song_id,tbl_songs.song_name,tbl_songs.song_url,case is_playing when 1 then 'playing' else '' end as is_playing, case when is_requested =1 or is_playing = 1 then 'display:none' else '' end as is_requested from tbl_player inner join tbl_songs on tbl_player.song_id = tbl_songs.song_id where is_played = 0 and is_played=0 order by order_number,requested_time"; db.fill_rptr_ret_sqlda(st, rpt_playlist); } }
public static string play_song(string songid) { mydb db = new mydb(); string st = ""; st = "select order_number from tbl_player where song_id = (select max(isnull(song_id,1)) from tbl_player where is_playing =1 or is_requested = 1)"; string val = db.read_val(st); st = "update tbl_player set is_requested=1 , requested_time = getdate(),order_number=" + val + " where song_id=" + songid; db.ExeQuery(st); return("done"); }