public ActionResult Delete(TabuladorModel 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("Tabulador eliminado con exito: " + model.ClaveNivel) })); } else { Log.write(this, "Delete", LOG.ERROR, "SQL:" + model.sql, sesion); return(Json(new { msg = Notification.Error(" Error al Eliminar: " + model.ClaveNivel) })); } } catch (Exception e) { return(Json(new { msg = Notification.Error(e.Message) })); } }
public ActionResult Add(TabuladorModel 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("Tabulador agregado con exito") })); } else { Log.write(this, "Add", LOG.ERROR, "SQL:" + model.sql, sesion); return(Json(new { msg = Notification.Error(" Error al agregar Ta bulador") })); } } catch (Exception e) { return(Json(new { msg = Factory.Notification.Error(e.Message) })); } }
public ActionResult Edit(TabuladorModel model) { if (model.Edit()) { return(Json(new JavaScriptSerializer().Serialize(model))); } return(View()); }
public string getNiveles(string Clave = "") { TabuladorModel model = new TabuladorModel(); string niveles = ""; niveles = model.Niveles(Clave); return(niveles); }
public string ConsultarTabulador(string CampusVPDI = "") { TabuladorModel model = new TabuladorModel(); model.CampusVPDI = CampusVPDI; SessionDB sesion = SessionDB.start(Request, Response, false, model.db, SESSION_BEHAVIOR.AJAX); if (sesion == null) { return(""); } StringBuilder sb = new StringBuilder(); sb.Append("<option></option>"); foreach (KeyValuePair <string, string> pair in model.getTabulador()) { sb.Append("<option value=\"").Append(pair.Key).Append("\" ").Append(">").Append(pair.Value).Append("</option>\n"); } return(sb.ToString()); }