//GET CREATE DATATABLE public string CreateDataTable(int show = 25, int pg = 1, string search = "", string orderby = "", string sort = "", string filterFecha = "", string sede = "") { if (sesion == null) { sesion = SessionDB.start(Request, Response, false, db); } DataTable table = new DataTable(); table.TABLE = "QNominaMesAnio"; String[] columnas = { "tipo_transferencia", "tipo_pago", "fecha_de_pago", "id", "empleado", "importe", "importe_iva", "importe_iva_retenido", "importe_isr_retenido", "bancos" }; String[] campos = { "tipo_transferencia", "tipo_pago", "fecha_de_pago", "id", "empleado", "importe", "importe_iva", "importe_iva_retenido", "importe_isr_retenido", "bancos" }; string[] campossearch = { "mes" }; table.CAMPOS = campos; table.COLUMNAS = columnas; table.CAMPOSSEARCH = campossearch; if (!filterFecha.Equals("")) { table.TABLECONDICIONSQL = "fecha_de_pago = '" + filterFecha + "'" + " and sede='" + sede + "'"; } table.orderby = orderby; table.sort = sort; table.show = show; table.pg = pg; table.search = search; table.field_id = "tipo_transferencia"; table.enabledButtonControls = false; return(table.CreateDataTable(sesion)); }
public ActionResult Delete(PensionadosModel model) { if (sesion == null) { sesion = SessionDB.start(Request, Response, false, db); } model.sesion = sesion; try { if (model.Delete()) { Log.write(this, "Delete", LOG.BORRADO, "SQL:" + model.sql, sesion); return(Json(new { msg = Notification.Succes("Beneficiario ELIMINADO con exito: " + model.IdPensionado) })); } else { Log.write(this, "Delete", LOG.ERROR, "SQL:" + model.sql, sesion); return(Json(new { msg = Notification.Error("Error al Eliminar la beneficiario = " + model.IdPensionado) })); } } catch (Exception e) { return(Json(new { msg = Notification.Error(e.Message) })); } }
public ActionResult Delete(BloqueosModel 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("Bloqueo ELIMINADO con exito: " + model.Bloqueo) })); } else { Log.write(this, "Delete", LOG.ERROR, "SQL:" + model.sql, sesion); return(Json(new { msg = Notification.Error("Error al Eliminar el Bloqueo = " + model.Bloqueo) })); } } catch (Exception e) { return(Json(new { msg = Notification.Error(e.Message) })); } }
// GET: Impuestos public ActionResult Start() { if (sesion == null) { sesion = SessionDB.start(Request, Response, false, db); } Main view = new Main(); ViewBag.MainUser = view.CreateMenuInfoUser(sesion); ViewBag.sedes = view.createSelectSedes("Sedes", sesion); ViewBag.Main = view.createMenu("Administración", "Variables", sesion); ViewBag.DataTable = CreateDataTable(10, 1, null, "VARIABLE", "ASC", sesion); ViewBag.Scripts = Scripts.addScript() + Scripts.setPrivileges(Privileges, sesion); if (!sesion.permisos.havePermission(Privileges[0].Permiso)) { return(View(Factory.View.NotAccess)); } Log.write(this, "Impuestos asimilados Start", LOG.CONSULTA, "Ingresa variables asimilados", sesion); return(View(Factory.View.Access + "Administracion/Variables/Start.cshtml")); }
public string getFechasdePagoEsquema(string EsquemaID = "", string FechaPago = "", string PersonaID = "") { ConceptosdePagoModel model = new ConceptosdePagoModel(); model.EsquemaID = EsquemaID; model.PersonaID = PersonaID; SessionDB sesion = SessionDB.start(Request, Response, false, model.db, SESSION_BEHAVIOR.AJAX); if (sesion == null) { return(""); } model.Usuario = sesion.pkUser.ToString(); StringBuilder sb = new StringBuilder(); string selected = ""; sb.Append("<option value=\"\"></option>\n"); foreach (KeyValuePair <string, string> pair in model.getFechasPago()) { selected = (FechaPago == pair.Value) ? "selected" : ""; sb.Append("<option value=\"").Append(pair.Key).Append("\" ").Append(selected).Append(">").Append(pair.Value).Append("</option>\n"); selected = ""; } return(sb.ToString()); }
//GET CREATE DATATABLE public string CreateDataTable(int show = 25, int pg = 1, string search = "", string orderby = "", string sort = "") { if (sesion == null) { sesion = SessionDB.start(Request, Response, false, db); } DataTable table = new DataTable(); table.TABLE = "FORMATOCONTRATOS"; String[] columnas = { "Clave", "Contrato", "Descripción", "Usuario", "Fecha de Modificación" }; String[] campos = { "Cve_Contrato", "Contrato", "Contrato_Descripcion", "USUARIO", "FECHA_M" }; string[] campossearch = { "Cve_Contrato", "Contrato", "Contrato_Descripcion" }; table.CAMPOS = campos; table.COLUMNAS = columnas; table.CAMPOSSEARCH = campossearch; table.orderby = orderby; table.sort = sort; table.show = show; table.pg = pg; table.search = search; table.field_id = "Cve_Contrato"; table.enabledButtonControls = false; table.addColumnFormat("Contrato", delegate(string Contrato, ResultSet res) { string retencion1 = "<a href=\"javascript:void(0)\" onClick=\"formPage.PrintPDF('" + res.Get("Cve_Contrato") + "');\"><i class=\"fa fa-print\"></i> " + Contrato + " </a>"; return(retencion1); }); return(table.CreateDataTable(sesion)); }
// GET: Tutoriales public ActionResult Start() { if ((sesion = SessionDB.start(Request, Response, false, db)) == null) { Response.Redirect("~/"); } Main view = new Main(); ViewBag.MainUser = view.CreateMenuInfoUser(sesion); ViewBag.Main = view.createMenu(62, 0, sesion); ViewBag.Scripts = Scripts.addScript() + Scripts.setPrivileges(Privileges, sesion); //Intercom ViewBag.User = sesion.nickName.ToString(); ViewBag.Email = sesion.nickName.ToString(); ViewBag.FechaReg = DateTime.Today; if (!sesion.permisos.havePermission(Privileges[0].Permiso)) { return(View(Factory.View.NotAccess)); } Log.write(this, "Start", LOG.CONSULTA, "Ingresa a pantalla 'Tutoriales' ", sesion); return(View(Factory.View.Access + "Tutoriales/Start.cshtml")); }
public ActionResult Start() { if (sesion == null) { sesion = SessionDB.start(Request, Response, false, db); } Main view = new Main(); ViewBag.MainUser = view.CreateMenuInfoUser(sesion); ViewBag.sedes = view.createSelectSedes("Sedes", sesion); ViewBag.Main = view.createMenu("Catalogos por Sede", "Centros de costos", sesion); ViewBag.TipoFactura = ConsultaTipoFacturas(); ViewBag.Escuelas = ConsultaEscuelas(); ViewBag.DataTable = CreateDataTable(10, 1, null, "CVE_CENTRODECOSTOS", "ASC"); ViewBag.Scripts = Scripts.addScript() + Scripts.setPrivileges(Privileges, sesion); //Intercom ViewBag.User = sesion.nickName.ToString(); ViewBag.Email = sesion.nickName.ToString(); ViewBag.FechaReg = DateTime.Today; if (!sesion.permisos.havePermission(Privileges[0].Permiso)) { return(View(Factory.View.NotAccess)); } Log.write(this, "Bancos Start", LOG.CONSULTA, "Ingresa pantalla Bancos", sesion); return(View(Factory.View.Access + "CatalogosPorSede/CentroCostos/Start.cshtml")); }
//GET CREATE DATATABLE public string CreateDataTable(int show = 25, int pg = 1, string search = "", string orderby = "", string sort = "", string filter = "") { if (sesion == null) { sesion = SessionDB.start(Request, Response, false, db); } DataTable table = new DataTable(); table.TABLE = "QCentrodeCostos01"; String[] columnas = { "ID CC", "Clave", "Descripción", "Tipo Factura", "Tipo de Pago", "Cuenta", "Cuenta IVA", "Cuenta IVA Ret", "Cuenta ISR Ret", "Sede", "Escuela", "Programa", "Usuario", "Fecha modificación" }; String[] campos = { "ID_CENTRODECOSTOS", "CVE_CENTRODECOSTOS", "CENTRODECOSTOS", "TIPOFACTURA", "TIPODEPAGO", "CUENTA", "CUENTA_IVA", "CUENTA_RETIVA", "CUENTA_RETISR", "SEDE", "ESCUELA", "PROGRAMA", "USUARIO", "FECHA_M", "CVE_SEDE" }; string[] campossearch = { "CVE_CENTRODECOSTOS", "CENTRODECOSTOS", "USUARIO", "TIPOFACTURA", "TIPODEPAGO", "CUENTA", "CUENTA_IVA", "CUENTA_RETIVA", "CUENTA_RETISR", "SEDE", "ESCUELA", "PROGRAMA", "FECHA_M" }; string[] camposhiden = { "CVE_SEDE" }; //"ID_CENTRODECOSTOS", table.CAMPOS = campos; table.COLUMNAS = columnas; table.CAMPOSSEARCH = campossearch; table.CAMPOSHIDDEN = camposhiden; table.TABLECONDICIONSQL = "CVE_SEDE = '" + filter + "'"; table.orderby = orderby; table.sort = sort; table.show = show; table.pg = pg; table.search = search; table.field_id = "ID_CENTRODECOSTOS"; table.enabledButtonControls = false; return(table.CreateDataTable(sesion)); }
public ActionResult Save(DatosPersonasModel 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()) { if (model.SaveTP()) { Log.write(this, "Save", LOG.EDICION, "SQL:" + model.sql, sesion); return Json(new { msg = Notification.Succes("Persona guardada con exito: " + model.Idsiu + " - " + model.Nombres + " " + model.Apellidos) }); } else { Log.write(this, "Save", LOG.EDICION, "SQL:" + model.sql, sesion); return Json(new { msg = Notification.Warning("Persona guardada con exito: " + model.Idsiu + " - " + model.Nombres + " " + model.Apellidos + ", pero con errores en la PA (tipo de pago).") }); } } else { Log.write(this, "Save", LOG.ERROR, "SQL:" + model.sql, sesion); return Json(new { msg = Notification.Error(" Error al guardar Persona: " + model.Idsiu + " - " + model.Nombres + " " + model.Apellidos) }); } } catch (Exception e) { return Json(new { msg = Notification.Error(e.Message) }); } }
public ActionResult Despublicar(GestiondePagosModel 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.publicar()) { model.init(); Log.write(this, "Publicar", LOG.REGISTRO, "SQL:" + model.sql, sesion); return(Json(new { msg = Notification.Succes("Despublicado(s) con exito ") })); } else { model.init(); Log.write(this, "Publicar", LOG.ERROR, "SQL:" + model.sql, sesion); return(Json(new { msg = Notification.Error(" Error al despublicar") })); } } catch (Exception e) { return(Json(new { msg = Factory.Notification.Error(e.Message) })); } }
public ActionResult getIdPersona(DatosPersonasModel model) { if ((sesion = SessionDB.start(Request, Response, false, db)) == null) { return Content("-1"); } if (model.getIdPersona()) { if (model.Id_Persona != "-1") { sesion.vdata["idPersona"] = model.Id_Persona; sesion.saveSession(); return Json(new JavaScriptSerializer().Serialize(model)); } else { Log.write(this, "Buscar IDSIU en formulario DatosPersonas X", LOG.ERROR, "SQL:" + model.sql, sesion); model.msg = Factory.Notification.Error(" La persona no existe en este contexto: " + model.Idsiu); return Json(new JavaScriptSerializer().Serialize(model)); } } else { Log.write(this, "Buscar IDSIU en formulario DatosPersonas Y", LOG.ERROR, "SQL:" + model.sql, sesion); model.msg = Factory.Notification.Error(" La persona no existe en este contexto: " + model.Idsiu); return Json(new JavaScriptSerializer().Serialize(model)); } //return View(); }
public ActionResult Start() { if ((sesion = SessionDB.start(Request, Response, false, db)) == null) { return Content(""); } Main view = new Main(); ViewBag.MainUser = view.CreateMenuInfoUser(sesion); ViewBag.sedes = view.createSelectSedes("Sedes", sesion); ViewBag.Main = view.createMenu("Personas", "Datos personas", sesion); ViewBag.DataTable = CreateDataTable(10, 1, null, "ID_PERSONA", "ASC", sesion); ViewBag.Scripts = Scripts.addScript() + Scripts.setPrivileges(Privileges, sesion); //Intercom ViewBag.User = sesion.nickName.ToString(); ViewBag.Email = sesion.nickName.ToString(); ViewBag.FechaReg = DateTime.Today; if (!sesion.permisos.havePermission(Privileges[0].Permiso)) return View(Factory.View.NotAccess); ViewBag.ComboNAC = CreaCombo("Select * from NACIONALIDADES order by NACIONALIDAD", "NACIONALIDAD", "NACIONALIDAD", "MEXICANA",true); ViewBag.ComboTPA = CreaCombo("Select * from TIPOSDEPAGO order by TIPODEPAGO", "CVE_TIPODEPAGO", "TIPODEPAGO", "",true); ViewBag.ComboORI = CreaCombo("Select * from ORIGENPERSONA order by ORIGEN", "CVE_ORIGEN", "ORIGEN", ""); ViewBag.ComboBAN = CreaCombo("Select * from BANCOS order by CVE_BANCO", "CVE_BANCO", "BANCO", "",true); ViewBag.ComboBANCO = CreaCombo("Select * from BANCOS order by CVE_BANCO", "CVE_BANCO", "BANCO", "",true); Log.write(this, "DatosPersonas Start", LOG.CONSULTA, "Ingresa Pantalla DatosPersonas", sesion); return View(Factory.View.Access + "Personas/DatosPersonas/Start.cshtml"); }
//GET CREATE DATATABLE public string CreateDataTable(int show = 25, int pg = 1, string search = "", string orderby = "", string sort = "", SessionDB sesion = null) { if (sesion == null) { sesion = SessionDB.start(Request, Response, false, db); } DataTable table = new DataTable(); table.TABLE = "TiposFactura"; String[] columnas = { "Clave", "Tipo de Factura", "Descripción", "Usuario", "Fecha modificación" }; String[] campos = { "CVE_TIPOFACTURA", "TIPOFACTURA", "TIPOFACTURADESCRIPCION", "USUARIO", "FECHA_M" }; string[] campossearch = { "CVE_TIPOFACTURA", "TIPOFACTURA", "TIPOFACTURADESCRIPCION", "USUARIO", "FECHA_M" }; table.CAMPOS = campos; table.COLUMNAS = columnas; table.CAMPOSSEARCH = campossearch; table.orderby = orderby; table.sort = sort; table.show = show; table.pg = pg; table.search = search; table.field_id = "CVE_TIPOFACTURA"; table.enabledButtonControls = false; table.addBtnActions("Editar", "editarTiposFactura"); return(table.CreateDataTable(sesion)); }
//GET CREATE DATATABLE public string CreateDataTable(int show = 25, int pg = 1, string search = "", string orderby = "", string sort = "") { if (sesion == null) { sesion = SessionDB.start(Request, Response, false, db); } DataTable table = new DataTable(); table.TABLE = "BANCOS"; String[] columnas = { "Clave", "Banco", "Transferencias", "Usuario", "Fecha modificación" }; String[] campos = { "CVE_BANCO", "BANCO", "TRANSFERENCIAS", "USUARIO", "FECHA_M" }; string[] campossearch = { "CVE_BANCO", "BANCO", "TRANSFERENCIAS" }; table.CAMPOS = campos; table.COLUMNAS = columnas; table.CAMPOSSEARCH = campossearch; table.orderby = orderby; table.sort = sort; table.show = show; table.pg = pg; table.search = search; table.field_id = "CVE_BANCO"; table.enabledButtonControls = false; table.addBtnActions("Editar", "editarBanco"); return(table.CreateDataTable(sesion)); }
public string Generar(string ids) { PAModel model = new PAModel(); //if ((model.sesion = SessionDB.start(Request, Response, false, model.db, SESSION_BEHAVIOR.AJAX)) == null) //return string.Empty; if (sesion == null) { sesion = SessionDB.start(Request, Response, false, db); } model.sesion = sesion; int totalPA; int registradosPA; int registradosPersonas; if (model.Generar(ids, out totalPA, out registradosPA, out registradosPersonas)) { Log.write(this, "Generar", LOG.EDICION, "ids:" + ids, model.sesion); return(Notification.Succes("Los datos se ha actualizado satisfactoriamente. " + registradosPA + "/" + totalPA + " registros (" + registradosPersonas + " personas)")); } else { return(Notification.Error("No se ha podido hacer la Generación completa (" + registradosPA + " / " + totalPA + " registros generados)")); } }
public ActionResult Save(ContratosWebModel 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) })); } }
public string getCampusPA() { PAModel model = new PAModel(); SessionDB sesion = SessionDB.start(Request, Response, false, model.db, SESSION_BEHAVIOR.AJAX); if (sesion == null) { return(""); } StringBuilder sb = new StringBuilder(); string selected = ""; string IdCampus = sesion.vdata["Sede"]; foreach (KeyValuePair <string, string> pair in model.getCampusPA()) { selected = (IdCampus == pair.Key) ? "selected" : ""; // sb.Append("<option value=\"").Append(pair.Key).Append("\">").Append(pair.Value).Append("</option>\n"); sb.Append("<option value=\"").Append(pair.Key).Append("\" ").Append(selected).Append(">").Append(pair.Value).Append("</option>\n"); selected = ""; } return(sb.ToString()); }
// GET: CalendariodePago public ActionResult Start() { if (sesion == null) { sesion = SessionDB.start(Request, Response, false, db); } Main view = new Main(); ViewBag.MainUser = view.CreateMenuInfoUser(sesion); ViewBag.Main = view.createMenu("Reportes", "Poliza contable por FD", sesion); ViewBag.sedes = view.createSelectSedes("Sedes", sesion); ViewBag.Scripts = Scripts.addScript() + Scripts.setPrivileges(Privileges, sesion); //Intercom ViewBag.User = sesion.nickName.ToString(); ViewBag.Email = sesion.nickName.ToString(); ViewBag.FechaReg = DateTime.Today; if (!sesion.permisos.havePermission(Privileges[0].Permiso)) { return(View(Factory.View.NotAccess)); } Log.write(this, "Start", LOG.CONSULTA, "Ingresa a pantalla 'Nómina por Año y Mes' ", sesion); return(View(Factory.View.Access + "Reports/ReportePolizaFD/Start.cshtml")); }
public bool Validate_Usuario_Admin(string client_user, string client_password, LoginModel model) { bool _valido = false; if (client_password != "") { string server_password = model.consultaPassword(client_user); string password = EncryptX.Decode(server_password); if (EncryptX.check(server_password, client_password)) { database db = new database(); SessionDB.afterLogIn(client_user, db, Request, Response); SessionDB sesion = SessionDB.start(Request, Response, false, db); //Log.write(this, "Validate", LOG.CONSULTA, "Detalle x", sesion); _valido = true; } else { ViewBag.Mensaje = "Su password es incorrecto"; } } else { ViewBag.Mensaje = "Ups, falta escribir su password"; } return(_valido); }
//GET CREATE DATATABLE public string CreateDataTable(int show, int pg, string search, string orderby, string sort, SessionDB sesion) { if (sesion == null) { if ((sesion = SessionDB.start(Request, Response, false, new database(), SESSION_BEHAVIOR.AJAX)) == null) { return(string.Empty); } } DataTable table = new DataTable(); string CheckIcon = "<i class=\"fa fa-check\"></i>"; table.TABLE = sesion.vdata["TABLE_CALENDARIORUA"]; table.COLUMNAS = new string[] { "Reg", "Año escolar", "Periodo", "Descripción", "Fecha Inicial", "Fecha Final", "Tipo de periodo" }; table.CAMPOS = new string[] { "REGISTRADO", "CVE_CICLO", "PERIODO", "DESCRIPCION", "FECHA_INICIAL", "FECHA_FINAL", "TIPOPERIODO" }; table.CAMPOSSEARCH = new string[] { "CVE_CICLO", "PERIODO", "DESCRIPCION", "FECHA_INICIAL", "FECHA_FINAL", "TIPOPERIODO" }; table.dictColumnFormat["REGISTRADO"] = delegate(string str, ResultSet res) { return(str == "True" ? CheckIcon : ""); }; table.orderby = orderby; table.sort = sort; table.show = show; table.pg = pg; table.search = search; table.field_id = "PERIODO"; table.enabledCheckbox = true; return(table.CreateDataTable(sesion)); }
public ActionResult Delete(Models.RoleModel 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()) { return(Json(new { msg = Notification.Succes("Eliminado Role con exito: " + model.Role) })); } else { return(Json(new { msg = Notification.Error(" Error al Eliminar: " + model.Role) })); } } catch (Exception e) { return(Json(new { msg = Notification.Error(e.Message) })); } }
//GET CREATE DATATABLE public string CreateDataTable(int show = 25, int pg = 1, string search = "", string orderby = "", string sort = "", SessionDB sesion = null) { if (sesion == null) { sesion = SessionDB.start(Request, Response, false, db); } DataTable table = new DataTable(); table.TABLE = "VARIABLES"; String[] columnas = { "Variable", "Valor", "Descripción", "Usuario", "Fecha Modificación" }; String[] campos = { "VARIABLE", "VALOR", "DESCRIPCION", "USUARIO", "FECHA_M" }; string[] campossearch = { "VARIABLE", "VALOR", "DESCRIPCION" }; table.CAMPOS = campos; table.COLUMNAS = columnas; table.CAMPOSSEARCH = campossearch; table.orderby = orderby; table.sort = sort; table.show = show; table.pg = pg; table.search = search; table.field_id = "VARIABLE"; table.enabledButtonControls = false; // table.addBtnActions("Editar", "editarImpuestos"); return(table.CreateDataTable(sesion)); }
public ActionResult Start() { SessionDB sesion = SessionDB.start(Request, Response, false, db); Main view = new Main(); ViewBag.MainUser = view.CreateMenuInfoUser(sesion); ViewBag.sedes = view.createSelectSedes("Sedes", sesion); ViewBag.Main = view.createMenu("Catalogos Centrales", "Sedes", sesion); ViewBag.DataTable = CreateDataTable(10, 1, null, "Cve_Sede", "ASC", sesion); //Intercom ViewBag.User = sesion.nickName.ToString(); ViewBag.Email = sesion.nickName.ToString(); ViewBag.FechaReg = DateTime.Today; ViewBag.Scripts = Scripts.addScript() + Scripts.setPrivileges(Privileges, sesion); ViewBag.ComboSO = CreaCombo("Select * from SOCIEDADES order by SOCIEDAD", "CVE_SOCIEDAD", "SOCIEDAD"); ViewBag.ComboCA = CreaCombo("Select * from QCampus order by CAMPUSDESCRIPCION", "CAMPUS_INB", "CAMPUSDESCRIPCION"); ViewBag.ComboTC = CreaCombo("Select * from QTiposContrato order by TIPOCONTRATODESCRIPCION", "TIPOCONTRATO_INB", "TIPOCONTRATODESCRIPCION"); if (!sesion.permisos.havePermission(Privileges[0].Permiso)) { return(View(Factory.View.NotAccess)); } Log.write(this, "Sedes Start", LOG.CONSULTA, "Ingresa pantalla Sedes", sesion); return(View(Factory.View.Access + "CatalogosCentrales/Sedes/Start.cshtml")); }
public ActionResult Save(PensionadosModel 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("Beneficiario guardado con exito") })); } else { Log.write(this, "Save", LOG.ERROR, "SQL:" + model.sql, sesion); return(Json(new { msg = Notification.Error(" Error al guardar beneficiario ") })); } } catch (Exception e) { return(Json(new { msg = Notification.Error(e.Message) })); } }
//GET CREATE DATATABLE public string CreateDataTable(int show = 25, int pg = 1, string search = "", string orderby = "", string sort = "", SessionDB sesion = null) { if (sesion == null) { sesion = SessionDB.start(Request, Response, false, db); } DataTable table = new DataTable(); table.TABLE = "QSedes"; String[] columnas = { "Clave", "Sede", "Campus INB", "Tipo Contrato INB", "Usuario", "Fecha modificación" }; String[] campos = { "Cve_Sede", "Sede", "CAMPUSDESCRIPCION", "TIPOCONTRATODESCRIPCION", "USUARIO", "FECHA_M" }; string[] campossearch = { "Sociedad", "CVE_Sede", "Sede", "CAMPUSDESCRIPCION", "TIPOCONTRATODESCRIPCION", "USUARIO", "FECHA_M" }; table.CAMPOS = campos; table.COLUMNAS = columnas; table.CAMPOSSEARCH = campossearch; table.orderby = orderby; table.sort = sort; table.show = show; table.pg = pg; table.search = search; table.field_id = "Cve_Sede"; table.enabledButtonControls = false; table.addBtnActions("Editar", "editarSedes"); return(table.CreateDataTable(sesion)); }
public ActionResult Add(BloqueosModel 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("Bloqueo agregado con exito: " + model.Bloqueo) })); } else { Log.write(this, "Add", LOG.ERROR, "SQL:" + model.sql, sesion); return(Json(new { msg = Notification.Error(" Error al agregar:" + model.Bloqueo) })); } } catch (Exception e) { return(Json(new { msg = Factory.Notification.Error(e.Message) })); } }
//GET CREATE DATATABLE public string CreateDataTable(int show, int pg, string search, string orderby, string sort, SessionDB sesion) { if (sesion == null) { if ((sesion = SessionDB.start(Request, Response, false, new database(), SESSION_BEHAVIOR.AJAX)) == null) { return(string.Empty); } } DataTable table = new DataTable(); string CheckIcon = "<i class=\"fa fa-check\"></i>"; table.TABLE = sesion.vdata["TABLE_TIPOSCONTRATO"]; table.COLUMNAS = new string[] { "Reg", "Tipo de Contrato", "Descripción" }; table.CAMPOS = new string[] { "REGISTRADO", "TIPOCONTRATO_INB", "TIPOCONTRATODESCRIPCION" }; table.CAMPOSSEARCH = new string[] { "TIPOCONTRATO_INB", "TIPOCONTRATODESCRIPCION" }; table.dictColumnFormat["REGISTRADO"] = delegate(string str, ResultSet res) { return(str == "True" ? CheckIcon : ""); }; //table.dictColumnFormat["IMPORTADO"] = delegate (string str) { return str == "True" ? CheckIcon : ""; }; table.orderby = orderby; table.sort = sort; table.show = show; table.pg = pg; table.search = search; table.field_id = "TIPOCONTRATO_INB"; table.enabledCheckbox = true; return(table.CreateDataTable(sesion)); }
public ActionResult Start() { if ((sesion = SessionDB.start(Request, Response, false, db)) == null) { return(Content("-1")); } Main view = new Main(); ViewBag.MainUser = view.CreateMenuInfoUser(sesion); ViewBag.sedes = view.createSelectSedes("Sedes", sesion); ViewBag.Main = view.createMenu("Catalogos Centrales", "Bloqueos", sesion); ViewBag.DataTable = CreateDataTable(10, 1, null, "Cve_Bloqueo", "ASC", sesion); //Intercom ViewBag.User = sesion.nickName.ToString(); ViewBag.Email = sesion.nickName.ToString(); ViewBag.FechaReg = DateTime.Today; ViewBag.Scripts = Scripts.addScript() + Scripts.setPrivileges(Privileges, sesion); if (!sesion.permisos.havePermission(Privileges[0].Permiso)) { return(View(Factory.View.NotAccess)); } Log.write(this, "Bloqueos Start", LOG.CONSULTA, "Ingresa Pantalla Bloqueos", sesion); return(View(Factory.View.Access + "CatalogosCentrales/Bloqueos/Start.cshtml")); }
public List<DBStruct> testSaveFeature() { SessionDB db = new SessionDB(); db.saveSessionintoDB("C:\\",0,0); return db.getSavedSessions(); }