| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 新增 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | public bool Insertattachment(OA_attachment model) |
| | | { |
| | | Model.OA_attachment trueModel = model as Model.OA_attachment; |
| | | if (trueModel == null) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | |
| | | IList<SqlParameter> sqlParms = new List<SqlParameter>() |
| | | { |
| | | new SqlParameter("@OA_Id",trueModel.OA_Id), |
| | | new SqlParameter("@CreateTime",trueModel.CreateTime), |
| | | new SqlParameter("@PlanAttachment",trueModel.PlanAttachment), |
| | | new SqlParameter("@AttachmentType",trueModel.AttachmentType), |
| | | new SqlParameter("@Operator",string.IsNullOrWhiteSpace(trueModel.Operator)?"":trueModel.Operator), |
| | | new SqlParameter("@AttachmentHouzhui",string.IsNullOrWhiteSpace(trueModel.AttachmentHouzhui)?"":trueModel.AttachmentHouzhui), |
| | | new SqlParameter("@AttachmentName",string.IsNullOrWhiteSpace(trueModel.AttachmentName)?"":trueModel.AttachmentName ), |
| | | |
| | | |
| | | }; |
| | | string sql = "Insert Into OA_attachment ( [OA_Id] , [PlanAttachment],[AttachmentType],[CreateTime],[Operator],[AttachmentHouzhui],[AttachmentName] )" |
| | | + " Values ( @OA_Id, @PlanAttachment,@AttachmentType,@CreateTime,@Operator,@AttachmentHouzhui,@AttachmentName )"; |
| | | try |
| | | { |
| | | _dataBase.ExecuteSql(sql, sqlParms.ToArray<SqlParameter>()); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw ex; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 根据厂商编号查询全部外协厂商 |
| | | /// </summary> |
| | | /// <param name="MemberId">编号</param> |
| | | /// <returns></returns> |
| | | public IEnumerable<OA_attachment> GetattachmentlList(string OA_Id) |
| | | { |
| | | if (OA_Id == null) |
| | | return null;//错误数据返会空 |
| | | |
| | | IList<OA_attachment> result = _dataBase.SelectModel<OA_attachment>("*", "OA_attachment", string.Format(" OA_Id='{0}' ORDER BY CreateTime DESC", OA_Id)) as IList<OA_attachment>;//执行查询 |
| | | |
| | | return result;//返回结果 |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 单个查询访问 |
| | | /// </summary> |
| | | /// <param name="Keyid">编号</param> |
| | | /// <returns></returns> |
| | | public OA_CorporateClientsVisit SelectVisitByKeyid(Guid Keyid) |
| | | { |
| | | if (Keyid == null) |
| | | return null;//错误数据返会空 |
| | | |
| | | IList<OA_CorporateClientsVisit> result = _dataBase.SelectModel<OA_CorporateClientsVisit>(" a.* ", " OA_CorporateClientsVisit a ", string.Format(" a.Keyid='{0}'", Keyid)) as IList<OA_CorporateClientsVisit>;//执行查询 |
| | | |
| | | return (null == result || result.Count == 0) ? null : result[0];//返回结果 |
| | | } |
| | | |
| | | } |
| | | } |