public FineOffice.Modules.OA_Attachment Update(FineOffice.Modules.OA_Attachment model) { dal.Initialization(); FineOffice.Entity.OA_Attachment entity = new Entity.OA_Attachment { ID = model.ID, Remark = model.Remark, ContractID = model.ContractID, AttachmentData = model.AttachmentData, FileName = model.FileName, PersonnelID = model.PersonnelID, RunProcessID = model.RunProcessID, Size = model.Size, LetterFollowID = model.LetterFollowID, CreateTime = model.CreateTime, XType = model.XType, XTypeName = model.XTypeName, }; dal.Update(entity); dal.Dispose(); return(null); }
/// <summary> /// 返回一个model /// </summary> /// <returns></returns> public FineOffice.Modules.OA_Attachment GetModel(System.Linq.Expressions.Expression <Func <FineOffice.Modules.OA_Attachment, bool> > expression) { dal.Initialization(); FineOffice.Modules.OA_Attachment model = (from entity in dal.GetListAll() select new FineOffice.Modules.OA_Attachment { ID = entity.ID, Remark = entity.Remark, ContractID = entity.ContractID, AttachmentData = entity.AttachmentData.ToArray(), PersonnelID = entity.HR_Personnel.ID, FileName = entity.FileName, RunProcessID = entity.RunProcessID, Size = entity.Size, LetterFollowID = entity.LetterFollowID, CreateTime = entity.CreateTime, XType = entity.XType, XTypeName = entity.XTypeName, }).Where(expression).FirstOrDefault(); dal.Dispose(); return(model); }