Example #1
0
        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);
        }
Example #2
0
        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");
            }
        }
Example #3
0
        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));
        }
Example #4
0
 public bool Update(Model.EstadoModel data)
 {
     return(base.Channel.Update(data));
 }
Example #5
0
 public bool Add(Model.EstadoModel data)
 {
     return(base.Channel.Add(data));
 }