public DataTable GetRoomNo_Info(string hotelcode) { BaseDL bdl = new BaseDL(); NpgsqlParameter[] Sqlprms = new NpgsqlParameter[1]; Sqlprms[0] = new NpgsqlParameter("@hotel_code", hotelcode); string cmdText = "Select hotel_roomno_count,roomno_fill_text from mst_hotel where hotel_code=@hotel_code"; DataTable dt = bdl.SelectDataTable_Info(cmdText, Sqlprms); if (dt.Rows.Count > 0) { return(dt); } return(dt); }
public bool checkStayLogin(string hotelcode, string usercode) { DataTable dt = new DataTable(); bool flag = false; BaseDL bdl = new BaseDL(); NpgsqlParameter[] para = new NpgsqlParameter[2]; para[0] = new NpgsqlParameter("@hotelcode", NpgsqlDbType.Varchar) { Value = hotelcode }; para[1] = new NpgsqlParameter("@usercode", NpgsqlDbType.Varchar) { Value = usercode }; string sql = "select logindate from mst_hoteluser where hotel_code=@hotelcode and usercode=@usercode"; dt = bdl.SelectDataTable_Info(sql, para); if (dt.Rows.Count > 0) { if (!string.IsNullOrEmpty(dt.Rows[0]["logindate"].ToString())) { DateTime currentDate = DateTime.Now; DateTime loginDate = Convert.ToDateTime(dt.Rows[0]["logindate"].ToString()); TimeSpan ts = currentDate - loginDate; double totalmins = ts.TotalMinutes; if (totalmins > 1) { flag = false; } else { flag = true; } } else { flag = false; } } return(flag); }