public List <PassingGoodsMasterModel> GetAll(int?id, DateTime?fromDate, DateTime?toDate, string userId, string approvalStatus)
        {
            try
            {
                var list = (from l in _db.SP_PASSINGGOODS_GET(id, fromDate, toDate, userId, approvalStatus)
                            select new PassingGoodsMasterModel()
                {
                    Id = l.Id,
                    Code = l.Code,

                    Applicant = l.Applicant,
                    ApplicantName = l.ApplicantName,

                    OrgName = l.OrgName,
                    PlantName = l.PlantName,
                    DeptName = l.DeptName,
                    SectionName = l.SectName,

                    ApprovalKind = l.ApprovalKind.ToString(),
                    ApprovalKindName = l.KindName,
                    ApprovalLineJson = l.ApprovalLineJson,
                    ApprovalLine = l.ApprovalLine,
                    ApprovalStatus = l.ApprovalStatus.ToString(),
                    ApprovalStatusName = l.ApprovalStatusName,
                    NextApprover = l.NextApprover,
                    NextApproverName = l.NextApproverName,

                    ApplicationDate = l.ApplicationDate,
                    ReImport = l.ReImport ?? false,
                    ReImportDate = l.ReImportDate,
                    Reason = l.Reason,

                    FinishApplication = l.FinishApplication ?? false,
                    FinishReason = l.FinishReason,
                    FinishDate = l.FinishDate,

                    CreateUid = l.CreateUid,
                    CreateName = l.CreateName,
                    CreateDate = l.CreateDate,

                    IsView = l.ISVIEW != 0,

                    ExportDate = l.ExportDate,
                    ExportUid = l.ExportUid,
                    ExportName = l.ExportName,
                    ExportGate = l.GateName
                }).ToList();
                if (list == null)
                {
                    return(null);
                }
                foreach (var item in list)
                {
                    item.IdEncrypt = Util.Encrypt(item.Id.ToString() + "_" + string.Format("hhss", DateTime.Now));
                }
                return(list);
            }
            catch (Exception ex)
            {
                LogHelper.Error("PassingGoodsRepository GetAll: " + ex.Message + " Inner Exception: " + ex.InnerException.Message);
                return(null);
            }
        }