public bool Update(Model.EstadoModel data) { bool result = false; try { var conn = Utils.HelperSettings.ReadString("ConnectionString"); var dal = new DAL.EstadoDAL(conn); dal.Update(data); result = true; } catch (Exception ex) { Utils.HelperLog.WriteText(ex, "EstadoService.Update"); } return(result); }
public void Insert(Model.EstadoModel data) { try { System.Data.SqlClient.SqlParameter[] parameters = new System.Data.SqlClient.SqlParameter[] { new System.Data.SqlClient.SqlParameter("@Pais", data.Pais), new System.Data.SqlClient.SqlParameter("@Nome", data.Nome), new System.Data.SqlClient.SqlParameter("@Sigla", data.Sigla), new System.Data.SqlClient.SqlParameter("@Regiao", data.Regiao) }; ExecuteCommand("usp_estado_insert", parameters); } catch (Exception ex) { Utils.HelperLog.WriteText(ex, "EstadoDAL.Insert"); } }
public ActionResult Add(Model.EstadoModel model) { try { if (ModelState.IsValid) { using (Web.EstadoProxy.EstadoServiceClient proxy = new Web.EstadoProxy.EstadoServiceClient()) { proxy.Add(model); } return(RedirectToAction("Index")); } } catch (Exception ex) { Utils.HelperLog.WriteText(ex, "EstadoController.Add[POST]"); } return(View(model)); }
public bool Update(Model.EstadoModel data) { return(base.Channel.Update(data)); }
public bool Add(Model.EstadoModel data) { return(base.Channel.Add(data)); }