public ActionResult AddTradeMark(TradeMarkModel tmModel) { var trademark = new TradeMark(); trademark.Name = tmModel.Name; TradeMarkDAO tmdao = new TradeMarkDAO(); tmdao.UpdateTradeMark(trademark); return(RedirectToAction("Index")); }
public ActionResult EditTradeMark(TradeMarkModel tmModel) { if (tmModel.IDTradeMark != 0) { TradeMarkDAO tmdao = new TradeMarkDAO(); var trademark = tmdao.GetTradeMarkByID(tmModel.IDTradeMark); trademark.Name = tmModel.Name; tmdao.UpdateTradeMark(trademark); } return(RedirectToAction("Index")); }