public List <ContasContabeis> GetContasContabeis() { try { var sql = this.Search(null, null); OpenConnection(); SqlQuery = new SqlCommand(sql, con); reader = SqlQuery.ExecuteReader(); var list = new List <ContasContabeis>(); while (reader.Read()) { var servico = new ContasContabeis { codigo = Convert.ToInt32(reader["ContasContabeis_ID"]), nomeConta = Convert.ToString(reader["ContasContabeis_Nome"]), classificacao = Convert.ToString(reader["ContasContabeis_Classificacao"]), situacao = Sistema.Util.FormatFlag.Situacao(Convert.ToString(reader["ContasContabeis_Situacao"])), vlSaldo = Convert.ToDecimal(reader["ContasContabeis_Saldo"]), dtCadastro = Convert.ToDateTime(reader["ContasContabeis_DataCadastro"]), dtUltAlteracao = Convert.ToDateTime(reader["ContasContabeis_DataUltAlteracao"]), }; list.Add(servico); } return(list); } catch (Exception error) { throw new Exception(error.Message); } finally { CloseConnection(); } }
public JsonResult JsUpdate(ContasContabeis model) { var daoContasContabeis = new DAOContasContabeis(); daoContasContabeis.Update(model); var result = new { type = "success", field = "", message = "Registro alterado com sucesso!", model = model }; return(Json(result, JsonRequestBehavior.AllowGet)); }