public static TradmarkModel ToDto(TradmarkEntity entity) { return(new TradmarkModel { TrdID = entity.TrdID, TrdName = entity.TrdName, TrdEnabled = entity.TrdEnabled }); }
public bool UpdateTradmark(TradmarkEntity tradmark) { string sql = @"[sp_tradmark_UPDATE]"; object[] obj = { "@TrdID", tradmark.TrdID, "@TrdName", tradmark.TrdName.Replace(" ", "") }; using (TransactionScope ts = new TransactionScope()) { try { Db.Update(sql, obj); ts.Complete(); return(true); } catch { return(false); } } }
public bool InsertTradmark(TradmarkEntity tradmark) { string sql = @"sp_tradmark_INSERT"; object[] obj = { "@TrdName", tradmark.TrdName.Replace(" ", "") }; using (TransactionScope ts = new TransactionScope()) { try { Db.Insert(sql, obj); ts.Complete(); return(true); } catch { return(false); } } }