Ejemplo n.º 1
0
    /// <summary>
    /// 取得值勤人員列表
    /// </summary>
    /// <param name="model">畫面model</param>
    /// <param name="datas">回傳資料</param>
    /// <param name="msg">回傳訊息</param>
    /// <returns>bool</returns>
    public static bool LoadDutyEmpID(WorkTimeViewModel model, out List <EmpListMobel> datas, out string msg)
    {
        bool result = false;

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