private void popupWindowShowActionGetXml_Execute(object sender, DevExpress.ExpressApp.Actions.PopupWindowShowActionExecuteEventArgs e) { CargaRecepcion obj = e.PopupWindowViewCurrentObject as CargaRecepcion; IObjectSpace objSp = Application.CreateObjectSpace(); NegocioAdmin.CrgDeXml(obj, objSp); }
private void simpleActionRprtCntbl_Execute(object sender, DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs e) { if (View != null) { NegocioAdmin.ReporteContable(View.ObjectSpace); } }
protected void lknDenegarTodo_Click(object sender, EventArgs e) { try { NegocioAdmin negAdmin = new NegocioAdmin(sistema.USR_LOGIN, sistema.PASS); List <E.VMPermisoItem> permisos = new NegocioSistema(sistema.USR_LOGIN, sistema.PASS). ObtenerPermisosItemsUsuario(lblNomUsuarioSelPermisosItem.Text /*Convert.ToBase64String(Tools.Encriptacion.Encriptar(lblNomUsuarioSelPermiso.InnerText))*/, Convert.ToInt32(ddlSistemasPermisos.SelectedItem.Value)); for (int i = 0; i < permisos.Count; i++) { permisos[i].Delete = false; permisos[i].Write = false; negAdmin.AsignarPermisosItems( permisos[i].IdUsuarioPermisos, permisos[i].Write, permisos[i].Delete ); } rgPermisos.DataSource = permisos; rgPermisos.DataBind(); } catch (Exception ex) { MostrarErrorPermisos("No fue posible asignar los permisos:" + ex.Message); } }
static void Main() { NegocioAdmin neg = new NegocioAdmin(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MenuPrincipal("Concesionario", neg)); }
private void simpleActionCncilr_Execute(object sender, DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs e) { if (View != null && View.ObjectSpace != null) { IObjectSpace objectSpace = Application.CreateObjectSpace(); CriteriaOperator[] operands = new CriteriaOperator[1]; operands[0] = new BinaryOperator("Concilia", true, BinaryOperatorType.NotEqual); SortProperty[] sortCollection = new SortProperty[1]; sortCollection[0] = new SortProperty("FechaDoc", SortingDirection.Ascending); IList arr = objectSpace.CreateCollection(typeof(DocumentoSalida), new GroupOperator(operands), sortCollection); Ventas vta = objectSpace.FindObject <Ventas>(null); foreach (string file in Directory.GetFiles(Directory.GetCurrentDirectory(), "*.xml")) { XmlDocument xml = new XmlDocument(); xml.Load(file); XmlNodeList nl = xml.GetElementsByTagName("tfd:TimbreFiscalDigital"); if (nl != null && nl.Count > 0) { XmlNode se = nl[0].Attributes.GetNamedItem("UUID"); XmlNode fe = nl[0].Attributes.GetNamedItem("FechaTimbrado"); if (se != null) { foreach (DocumentoSalida fac in arr) { if (!string.IsNullOrEmpty(fac.Uuid)) { if (se.Value == fac.Uuid) { string aux; /* * string aux = Directory.GetCurrentDirectory(); * aux = Path.Combine(aux, "Pdfs");*/ aux = Path.Combine(vta.VntCfdi.RutaPdfVnts, fac.Tipo.ToString()); aux = NegocioAdmin.CreaDirs(aux, fac.FechaDoc); aux = Path.Combine(aux, Path.GetFileName(file)); // string.Format("{0}-{1}.xml", it.ReciboN, it.Uuid)); File.Move(file, aux); // CreaPdfImprime(false, true, objectSpace); // NegocioNom.ImprFto("ReciboItem", false, true, NegocioNom.NamePdf(it), it, objectSpace); fac.Concilia = true; } } } } } } objectSpace.CommitChanges(); } }
private void ObjectSpace_Committing(object sender, System.ComponentModel.CancelEventArgs e) { Vendedor obj = View.CurrentObject as Vendedor; if (obj != null && View.ObjectSpace.IsNewObject(obj)) { NegocioAdmin.GrabaVendedor(obj); e.Cancel = false; } }
private void popupWindowShowActionDscrgMsv_Execute(object sender, DevExpress.ExpressApp.Actions.PopupWindowShowActionExecuteEventArgs e) { DescargaMasiva obj = e.PopupWindowViewCurrentObject as DescargaMasiva; if (obj != null) { NegocioAdmin.DescargaSat(obj, View.ObjectSpace, Prms); View.RefreshDataSource(); } }
private void simpleActionCncilr_Execute(object sender, DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs e) { if (View != null && View.ObjectSpace != null) { IObjectSpace objectSpace = Application.CreateObjectSpace(); NegocioAdmin.Concilia(objectSpace); objectSpace.CommitChanges(); } }
protected override void OnViewControlsCreated() { base.OnViewControlsCreated(); // Access and customize the target View control. if (View is DetailView) { if (View.ObjectSpace.IsNewObject(View.CurrentObject)) { NegocioAdmin.IniciaVendedor(View.CurrentObject as Vendedor); } } }
private void simpleActionTestCadnOrgnl_Execute(object sender, DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs e) { Certificado cert = View.CurrentObject as Certificado; FacturaE fac = new FacturaE(); NegocioAdmin.VaciaStructCert(fac, cert, View.ObjectSpace); fac.LeeInfoCFD(/*cert*/); if (fac.TestKy("Prueba de Genera Sello" /*, null*/)) { // FacturaE.GeneraSello("||3.2|2014-01-13T15:39:40|ingreso|PAGO EN UNA SOLA EXHIBICION|10.00|0.00|1.00000|MXN|11.60|NO IDENTIFICADO|Uaxaca,|No Identificado|AAA010101AAA|EMPRESA INVALIDA|Calle empresa|Numero|Colonia|Delegacion|Uaxaca|MÉXICO|codig|Calle empresa|MÉXICO|Regimen de la empresa|XAXX010101000|Cliente de mostrador nacional|DISTRITO FEDERAL|MÉXICO|1|Kilogramo|SRVC|SERVICIO CON IMPUESTO|10.00|10.00|IVA|16|1.60|1.60||"); XtraMessageBox.Show("Todo Bien !", "Certificado", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information); } }
private void MostraEdicionApp(int idSistema) { try { E.VMSistema sis = new NegocioAdmin(sistema.NOMBRE_USUARIO, sistema.PASS).ObtenerInformacionSistemas(idSistema); tbLogo.Text = sis.Logo; tbUrlHome.Text = sis.UrlHome; tbNombreApp.Text = sis.NombreSistema; chkAppExterna.Checked = !sis.Embebido; ddlEstatus.ClearSelection(); ddlEstatus.FindItemByValue(sis.Activo?"true":"false").Selected = true; hidIdApp.Value = idSistema.ToString(); mpeApp.Show(); } catch (Exception ex) { Master.MostrarMensajeError("Error: " + ex.Message); } }
private void MostrarModulos(int idSistema) { //Muestra modulos e items de la aplicacion try { NegocioAdmin negAdmin = new NegocioAdmin(sistema.USR_LOGIN, sistema.PASS); E.VMSistema sis = negAdmin.ObtenerInformacionSistemas(idSistema); List <E.VMRol> roles = negAdmin.ObtenerRoles(0); lblNomModuloSel.InnerText = sis.NombreSistema; hidIdApp.Value = idSistema.ToString(); CargarArbolSistema(idSistema); rtvModulos.DataBind(); ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "openWinModulo", "openWinModulo()", true); } catch (Exception ex) { Master.MostrarMensajeError(ex.Message); } }
/*mvg 06-12-2017*/ /*Se agerga para edicion de usuarios*/ private void GetInfoUsuario(string usuarioSistema) { try { btnRegistrar.Text = "Actualizar"; E.VMUsuario us = new NegocioAdmin(sistema.USR_LOGIN, sistema.PASS).ObtenerInfoUsuario(usuarioSistema); tbUsuario.Visible = false; lbUsuario.Visible = false; lbPass.Visible = false; tbPass.Visible = false; lbFechaVencimiento.Visible = true; tbFechaDeVencimiento.Visible = true; RadAjaxPanel1.Visible = true; tbApellidoM.Text = us.Apellido_materno; tbApellidoP.Text = us.Apellido_paterno; tbCelualar.Text = us.Celular; tbCorreo.Text = us.Correo; tbExtension.Text = us.Extension; tbNombre.Text = us.Nombre; DateTime _fecha = Convert.ToDateTime(us.FechaDeVencimiento); tbFechaDeVencimiento.Text = _fecha.ToShortDateString(); tbEstatus.SelectedValue = us.IdEstatus.ToString(); RadCalendar1.SelectedDate = _fecha; RadCalendar1.Focus(); RadCalendar1.FocusedDate = _fecha; mpeUsuario.Show(); } catch (Exception ex) { Master.MostrarMensajeError("No es posible modificar el registro:" + ex.Message); } }
void controller_CustomizeWindowStatusMessages(object sender, CustomizeWindowStatusMessagesEventArgs e) { string aux = string.Empty; emp = Application.CreateObjectSpace().FindObject <Empresa>(null); if (emp != null && emp.Compania != null) { e.StatusMessages.Add(emp.Compania.Nombre); if (emp.ConCfdi) { aux = "CFDI"; } else { aux = "CBB"; } } e.StatusMessages.Add(aux); if (emp != null && emp.ConCfdi) { aux = NegocioAdmin.Acabarse(Application.CreateObjectSpace()); if (!string.IsNullOrEmpty(aux)) { e.StatusMessages.Add(aux); } } // Viene null Connection // e.StatusMessages.Add(Window.Application.Connection.Database); IObjectSpace obsp = Application.CreateObjectSpace(); e.StatusMessages.Add(obsp.Database); }
private void RegistrarUsuario() { try { E.VMUsuario us = new NegocioAdmin(sistema.USR_LOGIN, sistema.PASS).RegistrarUsuario( tbNombre.Text, tbApellidoM.Text, tbApellidoP.Text, tbCelualar.Text, tbCorreo.Text, tbExtension.Text, 1, tbPass.Text, tbUsuario.Text ); mpeUsuario.Hide(); LimpiarFormularioRegistro(); ActualizarTablaUsuarios(); } catch (Exception ex) { MostrarErrorRegistro(ex.Message); } }
private void popupWindowShowActionGetXml_Execute(object sender, DevExpress.ExpressApp.Actions.PopupWindowShowActionExecuteEventArgs e) { IObjectSpace objectSpace = Application.CreateObjectSpace(); CargaRecepcion obj = e.PopupWindowViewCurrentObject as CargaRecepcion; Empresa emprs = View.ObjectSpace.FindObject <Empresa>(null); Ventas Prms = objectSpace.FindObject <Ventas>(null); string aux = Path.Combine(obj.Rt, "Extract"); string[] dirs = Directory.GetFiles(aux, "*.xml"); foreach (string dir in dirs) { DocumentoSalida rcpcn = objectSpace.CreateObject <DocumentoSalida>(); NegocioAdmin.ObtenXmlsVnts(rcpcn, emprs, Prms, dir); NegocioAdmin.GrabaDocumento(rcpcn, Prms, false); objectSpace.CommitChanges(); string auxX = $"{rcpcn.FechaDoc.Year}{rcpcn.FechaDoc.Month:d2}{rcpcn.FechaDoc.Day:d2}{Path.GetFileName(dir)}"; NegocioAdmin.Mueve(Path.GetDirectoryName(dir), Path.Combine(obj.Rt, "Factura"), Path.GetFileName(dir), auxX); } }
private void popupWindowShowActionLdXml_Execute(object sender, PopupWindowShowActionExecuteEventArgs e) { //http://icpac.blogspot.com/ IObjectSpace objectSpace = Application.CreateObjectSpace(); CargaRecepcion obj = e.PopupWindowViewCurrentObject as CargaRecepcion; Empresa emprs = View.ObjectSpace.FindObject <Empresa>(null); Ventas prms = objectSpace.FindObject <Ventas>(null); string aux = Path.Combine(obj.Rt, "Extract"); string[] dirs = Directory.GetFiles(aux, obj.Mtdt ? "*.txt" : "*.xml"); foreach (string dir in dirs) { if (obj.Mtdt) { NegocioAdmin.CargaMetaData(obj, "recepcion", objectSpace); } else { NegocioAdmin.CargaDeArchivo(dir, emprs, prms, obj, objectSpace); } /* * List<string> dts = NegocioAdmin.GetInfXml(dir); * bool addItms; // Para ver si agrego los items o no * * // Si el xml pertenece al Rfc de la bd * if (dts.Count > 2 && dts[2] == emprs.Compania.Rfc) * { * // Hay que ver si el uuid está dado de alta ya. * rcpcn = objectSpace.FindObject<Recepcion> * (new BinaryOperator("Uuid", dts[0])); * * addItms = false; * if (rcpcn == null) * { * addItms = true; * rcpcn = objectSpace.CreateObject<Recepcion>(); * } * * NegocioAdmin.ObtenDelXml(rcpcn, emprs, Prms, dir, addItms); * if (rcpcn.Proveedor != null) * { * if (addItms) * NegocioAdmin.GrabaDocs(rcpcn, Prms); * objectSpace.CommitChanges(); * * try * { * //string auxX = $"{rcpcn.FechaDoc.Year}{rcpcn.FechaDoc.Month:d2}{rcpcn.FechaDoc.Day:d2}{Path.GetFileName(dir)}"; * string auxX = Path.Combine(obj.Rt, "Recepcion"); * auxX = NegocioAdmin.CreaDirs(auxX, rcpcn.FechaDoc, true, Cap.Generales.Utilerias.ENivelDir.Mes); * * * NegocioAdmin.Mueve(Path.GetDirectoryName(dir), / *Path.Combine(obj.Rt, "Recepcion")* / * auxX, * Path.GetFileName(dir), Path.GetFileName(dir)/ *auxX* /); * } * catch(Exception ex) * { * Tracing.Tracer.LogText($"Compras: Obten del Xml {ex.Message}"); * } * * rcpcn = null; * } * }*/ } }
private void CargarArbolSistema(int idSistema) { NegocioAdmin negAdmin = new NegocioAdmin(sistema.USR_LOGIN, sistema.PASS); rtvModulos.Nodes.Clear(); E.VMSistema sis = negAdmin.ObtenerInformacionSistemas(idSistema); List <E.VMModulo> modulos = negAdmin.ObtenerModulosSistema(idSistema, null);//todos /*LIST_ITEMS = null; * * * * List<E.VMItemModulo> items = LIST_ITEMS; * var sistem = (from x in items * group x by x.IdSistema into g * select new * { * IdSistema = g.Key, * item = g.ToList() * } * ).ToList();*/ //Agrega sistemas RadTreeNode nodeSistema = new RadTreeNode(sis.NombreSistema, sis.IdSistema.ToString()); nodeSistema.Category = "SISTEMA"; /* var modulos = (from x in sistem[i].item * group x by x.IdModulo into g * select new * { * IdModulo = g.Key, * item = g.ToList() * } * ).ToList();*/ //Agregar modulos de sistema for (int j = 0; j < modulos.Count; j++) { /*List<E.VMItemModulo> itemsAsignados = new NegocioAdmin(sistema.USR_LOGIN, sistema.PASS).ObtenerItemsRolAsignados( * Convert.ToInt32(hidIdRolPermisos.Value));*/ RadTreeNode nodeModulo = new RadTreeNode(modulos[j].Nombre /*modulos[j].item[0].Modulo*/, modulos[j].IdModulo.ToString() /* modulos[j].IdModulo.ToString()*/); nodeModulo.Category = "MODULO"; TemplateNode template = new TemplateNode(); template.eventoAgregar = linkRegistrarPaginaModulo_Click; template.eventoDetalles = linkDetalleModuloItem_Click; template.eventoEditar = linkEditarModuloItem_Click; template.eventoEliminar = linkEliminarModuloItem_Click; nodeModulo.NodeTemplate = template; if (modulos[j].Items != null) { List <E.VMItemModulo> nodosHijos = (from x in modulos[j].Items where x.IdItemPadre == 0 select x).ToList(); AgregarNodosHijos(nodeModulo, nodosHijos , 0, modulos[j].Items.ToList()); nodeSistema.Nodes.Add(nodeModulo); } } rtvModulos.Nodes.Add(nodeSistema); rtvModulos.DataBind(); rtvModulos.ExpandAllNodes(); }
///<summary> ///Constructor del Form "Menu Principal" ///</summary> public MenuPrincipal(String nombreComercial, NegocioAdmin neg) { InitializeComponent(); this.Administrador = new NegocioAdmin(); this.Text = nombreComercial + ": Gestión de concesionario"; }
private void MostrarRolesAsignados(string usuarioSistema) { try { LIST_ROLES_SIS = null; rtvRolesDisponibles.Nodes.Clear(); rtvRolesAsignados.Nodes.Clear(); //Roles disponibles List <E.VMRol> roles = LIST_ROLES_SIS; //Roles asignados List <E.VMRol> rolesAsignados = new NegocioAdmin(sistema.USR_LOGIN, sistema.PASS).ObtenerRolesUsuario(usuarioSistema, Convert.ToInt32(ddlSistemas.SelectedItem.Value)); var rolesDisponibles = (from x in roles group x by x.IdPais into rolPais select new { idPais = rolPais.Key, roles = rolPais.ToList() }).ToList(); for (int i = 0; i < rolesDisponibles.Count(); i++) { RadTreeNode nodoPais = new RadTreeNode(rolesDisponibles[i].roles[0].Pais, rolesDisponibles[i].idPais.ToString()); nodoPais.AllowDrag = false; nodoPais.AllowDrop = false; foreach (E.VMRol rol in rolesDisponibles[i].roles) { if (rolesAsignados.Where(x => x.IdRol == rol.IdRol).FirstOrDefault() == null) { RadTreeNode nodoItem = new RadTreeNode(rol.Nombre, rol.IdRol.ToString()); nodoItem.Attributes.Add("Descripcion", rol.Descripcion); nodoItem.AllowDrag = true; nodoItem.AllowDrop = true; nodoPais.Nodes.Add(nodoItem); } } if (nodoPais.Nodes.Count > 0) { rtvRolesDisponibles.Nodes.Add(nodoPais); } } //Muestra roles asigandos var rolesUsuario = (from x in rolesAsignados group x by x.IdPais into rolPais select new { idPais = rolPais.Key, roles = rolPais.ToList() }).ToList(); for (int i = 0; i < rolesUsuario.Count(); i++) { RadTreeNode nodoPais = new RadTreeNode(rolesUsuario[i].roles[0].Pais, rolesUsuario[i].idPais.ToString()); nodoPais.AllowDrag = false; nodoPais.AllowDrop = false; foreach (E.VMRol rol in rolesUsuario[i].roles) { RadTreeNode nodoItem = new RadTreeNode(rol.Nombre, rol.IdRol.ToString()); nodoItem.Attributes.Add("Descripcion", rol.Descripcion); nodoItem.AllowDrag = true; nodoItem.AllowDrop = true; nodoPais.Nodes.Add(nodoItem); } rtvRolesAsignados.Nodes.Add(nodoPais); } rtvRolesDisponibles.ExpandAllNodes(); rtvRolesDisponibles.DataBind(); rtvRolesAsignados.ExpandAllNodes(); rtvRolesAsignados.DataBind(); lblNomUsuarioSel.InnerText = usuarioSistema; ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "openWinRoles", "openWinRoles()", true); } catch (Exception ex) { MostrarErrorRoles(ex.Message); } }
public LoginComercial() { InitializeComponent(); neg = new NegocioAdmin(); }
private bool Licencia() { return(NegocioAdmin.Licencia(View.ObjectSpace)); }
private void singleChoiceActionPolz_Execute(object sender, DevExpress.ExpressApp.Actions.SingleChoiceActionExecuteEventArgs e) { int mes = Convert.ToInt32((e.SelectedChoiceActionItem.Data)); NegocioAdmin.PolizaPel(Application.CreateObjectSpace(), mes); }