Beispiel #1
0
    /// <summary>
    /// 取得假單檔
    /// </summary>
    /// <param name="model">畫面model</param>
    /// <param name="datas">回傳資料</param>
    /// <param name="msg">回傳訊息</param>
    /// <returns>bool</returns>
    public static bool GetVacInfo(WorkTimeViewModel model, out int cnt, out string msg)
    {
        bool result = false;

        msg = "";
        cnt = 0;
        try
        {
            using (var conn = new SqlConnection()
            {
                ConnectionString = DbHelper.getConnectionStrings(_attendantDBName).ConnectionString
            })
            {
                try
                {
                    cnt = Convert.ToInt32(conn.ExecuteScalar(WorkTimeSql.GetVacInfo(), model));
                }
                catch (Exception)
                {
                    throw;
                }
            }
            result = true;
        }
        catch (Exception ex)
        {
            msg = ex.Message;
        }
        return(result);
    }