Beispiel #1
0
    /// <summary>
    /// 查詢EmpGuardWorkTime資料
    /// </summary>
    /// <param name="model">畫面model</param>
    /// <param name="datas">回傳資料</param>
    /// <param name="msg">回傳訊息</param>
    /// <returns>bool</returns>
    public static bool LoadEmpGuardWorkTimeGridData(EmpGuardWorkTimeModel model, out List <DutyQueryListBean> datas, out string msg)
    {
        bool result = false;

        msg   = "";
        datas = new List <DutyQueryListBean>();
        try
        {
            using (var conn = new SqlConnection()
            {
                ConnectionString = DbHelper.getConnectionStrings(_attendantDBName).ConnectionString
            })
            {
                try
                {
                    datas = conn.Query <DutyQueryListBean>(WorkTimeSql.LoadEmpGuardWorkTimeGridData(model), model).ToList();
                }
                catch (Exception)
                {
                    throw;
                }
            }
            result = true;
        }
        catch (Exception ex)
        {
            msg = ex.Message;
        }
        return(result);
    }