public bool ExistsRecord(string DocID, string id) { var query = new Sql("select * from [APlatformAppSchema].[lnRIRecord] where DocID=@0 and IsDelete=0 and DocID <> @1", new SqlParameter { DbType = DbType.String, Value = DocID }, new SqlParameter { DbType = DbType.String, Value = id }); lnRIRecord record = null; try { record = lnRIRecord.SingleOrDefault(query); if (record != null) { return(true); } else { return(false); } } catch { return(false); } }
public RIRecordModel AddRecord(RIRecordModel cplnRIRecord) { RIRecordModel result = null; lnRIRecord _record = null; try { _record = Mapper.Map <lnRIRecord>(cplnRIRecord); var recordId = Convert.ToInt64(_record.Insert()); result = cplnRIRecord; } catch (Exception ex) { LogHelper.Error <lnRIRecordDataProvider>("Add lnRIRecord Failed! \n", ex); } return(result); }
public RIRecordModel AddRecord(RIRecordModel _et1, LnRIRecordEntityModel _et2) { RIRecordModel result = null; lnRIRecord _r1 = null; lnRIRecordEntity _r2 = null; _r1 = Mapper.Map <lnRIRecord>(_et1); _r2 = Mapper.Map <lnRIRecordEntity>(_et2); _r1.Insert(); _r2.Insert(); result = _et1; return(result); }
public RIRecordModel UpdateRecord(RIRecordModel cplnRIRecord) { RIRecordModel result = null; lnRIRecord _record = null; try { _record = Mapper.Map <lnRIRecord>(cplnRIRecord); _record.Update(); result = Mapper.Map <RIRecordModel>(_record); } catch (Exception ex) { LogHelper.Error <lnRIRecordDataProvider>("Update lnRIRecord Failed! \n", ex); } return(result); }