public ActionResult Delete(TiposPagoModel model) { if (sesion == null) { sesion = SessionDB.start(Request, Response, false, db); } model.sesion = sesion; if (!sesion.permisos.havePermission(Privileges[0].Permiso)) { return(Json(new { msg = Notification.notAccess() })); } try { if (model.Delete()) { Log.write(this, "Delete", LOG.BORRADO, "SQL:" + model.sql, sesion); return(Json(new { msg = Notification.Succes("Tipo de Pago ELIMINADO con exito: " + model.TipodePago) })); } else { Log.write(this, "Delete", LOG.ERROR, "SQL:" + model.sql, sesion); return(Json(new { msg = Notification.Error("Error al Eliminar el Tipo de Pago = " + model.TipodePago) })); } } catch (Exception e) { return(Json(new { msg = Notification.Error(e.Message) })); } }
public ActionResult Add(TiposPagoModel model) { if (sesion == null) { sesion = SessionDB.start(Request, Response, false, db); } model.sesion = sesion; if (!sesion.permisos.havePermission(Privileges[0].Permiso)) { return(Json(new { msg = Notification.notAccess() })); } try { if (model.Add()) { Log.write(this, "Add", LOG.REGISTRO, "SQL:" + model.sql, sesion); return(Json(new { msg = Notification.Succes("Tipo de Pago agregado con exito: " + model.TipodePago) })); } else { Log.write(this, "Add", LOG.ERROR, "SQL:" + model.sql, sesion); return(Json(new { msg = Notification.Error(" Error al agregar:" + model.TipodePago) })); } } catch (Exception e) { return(Json(new { msg = Factory.Notification.Error(e.Message) })); } }
public string CreaCombo(string Sql = "", string Clave = "", string Valor = "") { string Salida = ""; TiposPagoModel model = new TiposPagoModel(); Salida = model.ComboSql(Sql, Clave, Valor); return(Salida); }
public ActionResult Edit(TiposPagoModel model) { if (model.Edit()) { return(Json(new JavaScriptSerializer().Serialize(model))); } return(View()); }