public ActionResult Save(ContratosWebPreviewModel 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.Save())
                {
                    Log.write(this, "Save", LOG.EDICION, "SQL:" + model.sql, sesion);
                    return(Json(new { msg = Notification.Succes("Contrato guardado con exito: " + model.Contrato) }));
                }
                else
                {
                    Log.write(this, "Save", LOG.ERROR, "SQL:" + model.sql, sesion);
                    return(Json(new { msg = Notification.Error(" Error al GUARDAR: " + model.Contrato) }));
                }
            }
            catch (Exception e)
            {
                return(Json(new { msg = Notification.Error(e.Message) }));
            }
        }