/// <summary> /// 查詢值班人數 /// </summary> /// <param name="model">畫面model</param> /// <param name="msg">回傳訊息</param> /// <returns>bool</returns> public static bool SelectDutyCnt(EmpGuardWorkTimeBean dataBean, out int cnt, out string msg) { bool result = false; msg = ""; cnt = 0; try { using (var conn = new SqlConnection() { ConnectionString = DbHelper.getConnectionStrings(_attendantDBName).ConnectionString }) { conn.Open(); try { cnt = Convert.ToInt32(conn.ExecuteScalar(WorkTimeSql.SelectDutyCnt(), dataBean)); } catch (Exception) { throw; } } result = true; } catch (Exception ex) { msg = ex.Message; } return(result); }