Ejemplo n.º 1
0
 private void ubAgregarOP_Click(object sender, EventArgs e)
 {
     try
     {
         Collection        Ops            = new Collection();
         FrmSelectedEntity FrmSeleccionar = new FrmSelectedEntity();
         String            Filtro         = GuiaRemision.ObtenerFiltroOps();
         Filtro = (Filtro.Length > 0) ? String.Format(" ID NOT IN ({0}) AND IDCliente = '{1}' ", Filtro, GuiaRemision.Cliente.ID) : String.Format(" IDCliente = '{0}' ", GuiaRemision.Cliente.ID);
         Ops    = FrmSeleccionar.GetSelectedsEntities(typeof(OrdenProduccion), "Seleccion Ordendes Guias de Remision", Filtro);
         foreach (OrdenProduccion ItemOP in Ops)
         {
             ItemGuiaRemision Item = GuiaRemision.AddItem();
             Item.IDOrdenProduccion = ItemOP.ID;
             Item.NroOP             = ItemOP.Numeracion;
             Item.Descripcion       = ItemOP.Descripcion;
             Item.CantidadOP        = (ItemOP.Cantidad - ItemOP.CantidadEntregada);
             Item.Cantidad          = Item.CantidadOP;
         }
         MostrarItems();
     }
     catch (Exception ex)
     {
         SoftException.Control(ex);
     }
 }
Ejemplo n.º 2
0
        public override void Start()
        {
            using (ISession Sesion = m_SessionFactory.OpenSession())
            {
                using (ITransaction Trans = Sesion.BeginTransaction())
                {
                    try
                    {
                        Auditoria       Auditoria       = Auditoria.ConstruirAuditoria(base.m_ObjectFlow, "Modificar");
                        OrdenProduccion OrdenProduccion = (OrdenProduccion)m_ObjectFlow;

                        if (!OrdenProduccion.EstadoAprobacion.Equals("PENDIENTE"))
                        {
                            throw new Exception("El Orden Produccion numero " + OrdenProduccion.Numeracion + " se encuentra " + OrdenProduccion.EstadoAprobacion);
                        }



                        Sesion.Update(OrdenProduccion);
                        Sesion.Save(Auditoria);
                        Trans.Commit();
                        m_ResultProcess = EnumResult.SUCESS;
                    }
                    catch (Exception ex)
                    {
                        Trans.Rollback();
                        m_ResultProcess = EnumResult.ERROR;
                        SoftException.Control(ex);
                    }
                }
            }
            base.Start();
        }
Ejemplo n.º 3
0
 private void ubNuevoItemTransporte_Click(object sender, EventArgs e)
 {
     try
     {
         if (string.IsNullOrEmpty(SalidaCaja.IDListaPreciosTransporte))
         {
             throw new Exception("Debe de seleccionar una lista de precios de transporte...");
         }
         else
         {
             FrmSeleccionarDireccion FrmSeleccionar = new FrmSeleccionarDireccion();
             ItemSalidaCaja          itemSalidaCaja = SalidaCaja.AddItem();
             itemSalidaCaja.Cantidad         = 1;
             itemSalidaCaja.EsTipoTransporte = true;
             FrmSeleccionar.ObtenerItemSalidaCaja(ref itemSalidaCaja);
             CalcularPrecio(itemSalidaCaja);
             UltraGridRow RowNuevo = ugItems.DisplayLayout.Bands[0].AddNew();
             RowNuevo.Tag = itemSalidaCaja;
             Mostrar();
         }
     }
     catch (Exception ex)
     {
         SoftException.Control(ex);
     }
 }
Ejemplo n.º 4
0
        private void ugItems_CellChange(object sender, CellEventArgs e)
        {
            try
            {
                ItemRendicionCotizacion Item = (ItemRendicionCotizacion)e.Cell.Row.Tag;
                switch (e.Cell.Column.Key)
                {
                case colCantidadReal:
                    Item.CantidadReal = Convert.ToDecimal(e.Cell.Text.Replace('_', ' '));
                    Item.TotalReal    = Item.CantidadReal * Item.PrecioReal;
                    MostrarItem(e.Cell.Row);
                    MostrarTotales();
                    break;

                case colPrecioReal:
                    Item.PrecioReal = Convert.ToDecimal(e.Cell.Text.Replace('_', ' '));
                    Item.TotalReal  = Item.CantidadReal * Item.PrecioReal;
                    MostrarItem(e.Cell.Row);
                    MostrarTotales();
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                SoftException.Control(ex);
            }
        }
Ejemplo n.º 5
0
 private void ubNuevo_Click(object sender, EventArgs e)
 {
     try
     {
         FrmSelectedEntity FrmSeleccionar = new FrmSelectedEntity();
         Existencia        servicio       = (Existencia)FrmSeleccionar.GetSelectedEntity(typeof(Existencia), "Selección de Servicios");
         if (servicio != null)
         {
             ItemRendicionCotizacion item = new ItemRendicionCotizacion();
             item.Codigo             = servicio.Codigo;
             item.Descripcion        = servicio.Nombre;
             item.CantidadCotizacion = 0;
             item.PrecioCotizacion   = 0;
             item.TotalCotizacion    = 0;
             item.CantidadReal       = 0;
             item.PrecioReal         = 0;
             item.TotalReal          = 0;
             RendicionCotizacion.Items.Add(item);
             MostrarItems();
             MostrarTotales();
         }
     }
     catch (Exception ex)
     {
         SoftException.Control(ex);
     }
 }
Ejemplo n.º 6
0
 public void ValidarUsuario(String Usuario, String Clave)
 {
     try
     {
         XmlDocument XML = HelperNHibernate.ExecuteView("vSF_Usuario", String.Format(" UserID = '{0}' AND Contrasena = '{1}'", Usuario, Clave));
         if (XML.HasChildNodes)
         {
             foreach (XmlNode NodoItem in XML.DocumentElement.ChildNodes)
             {
                 Usuario User = (Usuario)HelperNHibernate.GetEntityByID("Usuario", NodoItem.SelectSingleNode("@ID").Value);
                 CargarSyn(User.Skyn);
                 FrmMain FrmMain = new FrmMain();
                 FrmMain.IniciarAplicacion(User);
                 Hide();
             }
         }
         else
         {
             throw new Exception("Usuario o Clave Incorrectos ...");
         }
     }
     catch (Exception ex)
     {
         SoftException.Control(ex, SystemIcons.Warning.ToBitmap());
     }
 }
Ejemplo n.º 7
0
        public override void Start()
        {
            using (ISession Sesion = m_SessionFactory.OpenSession())
            {
                using (ITransaction Trans = Sesion.BeginTransaction())
                {
                    try
                    {
                        Presupuesto Presupuesto = (Presupuesto)m_ObjectFlow;
                        if (!Presupuesto.EstadoAceptacion.Equals("ACEPTADO"))
                        {
                            throw new Exception(String.Format("El presupuesto número {0} aun no esta aceptado por el cliente", Presupuesto.Numeracion));
                        }

                        if (Presupuesto.EstadoOrdenProduccion.Equals("TOTAL"))
                        {
                            throw new Exception(String.Format("El presupuesto número {0} ya tiene generadas una orden de produccion", Presupuesto.Numeracion));
                        }


                        m_ResultProcess = EnumResult.SUCESS;
                    }
                    catch (Exception ex)
                    {
                        Trans.Rollback();
                        m_ResultProcess = EnumResult.ERROR;
                        SoftException.Control(ex);
                    }
                }
            }
            base.Start();
        }
Ejemplo n.º 8
0
        private void ugCotizaciones_CellChange(object sender, CellEventArgs e)
        {
            try
            {
                ItemPresupuesto Item = (ItemPresupuesto)e.Cell.Row.Tag;
                switch (e.Cell.Column.Key)
                {
                case colTotalFinal:
                    Item.TotalFinal = Convert.ToDecimal(e.Cell.Text.Replace('_', ' '));
                    e.Cell.Row.Cells[colRecargo].Value = Item.TotalFinal - Item.Total;
                    uneTotal.Value = Presupuesto.Total;
                    break;

                case colRecargo:
                    Item.TotalFinal = Convert.ToDecimal(e.Cell.Text.Replace('_', ' ')) + Item.Total;
                    e.Cell.Row.Cells[colTotalFinal].Value = Item.TotalFinal;
                    uneTotal.Value = Presupuesto.Total;
                    break;

                default:
                    break;
                }
                // MostrarItems(false);
            }
            catch (Exception ex)
            {
                SoftException.Control(ex);
            }
        }
Ejemplo n.º 9
0
        private void ubAgregarOP_Click(object sender, EventArgs e)
        {
            try
            {
                Collection        Ops            = new Collection();
                FrmSelectedEntity FrmSeleccionar = new FrmSelectedEntity();
                String            Filtro         = Facturacion.ObtenerFiltroOps();
                Filtro = (Filtro.Length > 0) ? String.Format(" ID NOT IN ({0}) AND IDCliente = '{1}' AND EstadoFacturacion <> 'TOTAL'", Filtro, Facturacion.Cliente.ID) : String.Format(" IDCliente = '{0}' AND EstadoFacturacion <> 'TOTAL'", Facturacion.Cliente.ID);
                Ops    = FrmSeleccionar.GetSelectedsEntities(typeof(OrdenProduccion), "Selección de Ordenes de Producción", Filtro);
                foreach (OrdenProduccion ItemOP in Ops)
                {
                    ItemFacturacion Item = Facturacion.AddItem();
                    Item.IDOrdenProduccion = ItemOP.ID;
                    Item.NroOP             = ItemOP.Numeracion;
                    Item.Descripcion       = ItemOP.Descripcion;
                    Item.CantidadOP        = (ItemOP.Cantidad - ItemOP.CantidadFacturada);
                    Item.Cantidad          = Item.CantidadOP;

                    ItemPresupuesto itemPresupuesto = (ItemPresupuesto)HelperNHibernate.GetEntityByID("ItemPresupuesto", ItemOP.IDItemPresupuesto);
                    Item.Precio = (itemPresupuesto.TotalFinal / ItemOP.Cantidad);
                }
                MostrarItems();
                MostrarTotales();
            }
            catch (Exception ex)
            {
                SoftException.Control(ex);
            }
        }
Ejemplo n.º 10
0
        private void busClasificacion_Search(object sender, EventArgs e)
        {
            try
            {
                String filtro = "";

                if (busClasificacion.Text.Length > 0)
                {
                    filtro = "Nombre like '" + busClasificacion.Text + "%'";
                }
                FrmSelectedEntity       FrmSeleccionarPanel = new FrmSelectedEntity();
                ClasificacionExistencia clasificacion       = null;

                clasificacion = (ClasificacionExistencia)FrmSeleccionarPanel.GetSelectedEntity(typeof(ClasificacionExistencia), "Clasificación de Existencia", filtro);


                if ((clasificacion != null))
                {
                    this.Existencia.ClasificacionExistencia = clasificacion;
                    Existencia.ItemClasificacionExistencia  = null;
                }

                Mostrar();
            }
            catch (Exception ex)
            {
                SoftException.Control(ex);
            }
        }
Ejemplo n.º 11
0
        private void ugOrdenesProduccion_CellChange(object sender, CellEventArgs e)
        {
            try
            {
                ItemGuiaRemision Item = (ItemGuiaRemision)e.Cell.Row.Tag;
                switch (e.Cell.Column.Key)
                {
                case colCantidad:
                    decimal Cantidad = Convert.ToDecimal(e.Cell.Text.Replace('_', ' '));
                    if (Cantidad > Item.CantidadOP)
                    {
                        throw new Exception("La cantidad no puede ser mayor a : " + Item.CantidadOP);
                    }
                    else
                    {
                        Item.Cantidad = Cantidad;
                    }
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                SoftException.Control(ex);
            }
            finally
            {
                MostrarItem(e.Cell.Row);
            }
        }
Ejemplo n.º 12
0
        public override void Start()
        {
            using (ISession Sesion = m_SessionFactory.OpenSession())
            {
                using (ITransaction Trans = Sesion.BeginTransaction())
                {
                    try
                    {
                        Auditoria           Auditoria = Auditoria.ConstruirAuditoria(base.m_ObjectFlow, "Modificación");
                        SolicitudCotizacion cp        = (SolicitudCotizacion)m_ObjectFlow;

                        SolicitudCotizacion cpactual = (SolicitudCotizacion)HelperNHibernate.GetEntityByID("SolicitudCotizacion", cp.ID);

                        if (cpactual.EstadoAprobacion.Equals("PENDIENTE"))
                        {
                            Sesion.Update(cp);
                            Sesion.Save(Auditoria);
                            Trans.Commit();
                            m_ResultProcess = EnumResult.SUCESS;
                        }
                        else
                        {
                            throw new Exception("Estado " + cpactual.EstadoAprobacion + " del documento no permite modificaciones");
                        }
                    }
                    catch (Exception ex)
                    {
                        Trans.Rollback();
                        m_ResultProcess = EnumResult.ERROR;
                        SoftException.Control(ex);
                    }
                }
            }
            base.Start();
        }
 public override void Start()
 {
     using (ISession Sesion = m_SessionFactory.OpenSession())
     {
         using (ITransaction Trans = Sesion.BeginTransaction())
         {
             try
             {
                 Presupuesto cp = (Presupuesto)m_ObjectFlow;
                 if (cp.TipoDocumento.GeneraNumeracionAlFinal == true)
                 {
                     SqlCommand SqlCmd = new SqlCommand();
                     SqlCmd.Connection = (SqlConnection)Sesion.Connection;
                     Trans.Enlist(SqlCmd);
                     SqlCmd.CommandText = "pSF_NumeracionFinal_Presupuesto";
                     SqlCmd.CommandType = System.Data.CommandType.StoredProcedure;
                     SqlCmd.Parameters.AddWithValue("@IDCp", cp.ID);
                     SqlCmd.Parameters.AddWithValue("@IDTipoCp", cp.TipoDocumento.ID);
                     SqlCmd.ExecuteNonQuery();
                     Trans.Commit();
                     m_ResultProcess = EnumResult.SUCESS;
                 }
             }
             catch (Exception ex)
             {
                 Trans.Rollback();
                 m_ResultProcess = EnumResult.ERROR;
                 SoftException.Control(ex);
             }
         }
     }
     base.Start();
 }
 private void ssTipoDocumento_Search(object sender, EventArgs e)
 {
     try
     {
         if (ActualizandoIU)
         {
             return;
         }
         InfoAsistente.Presupuesto   = (Presupuesto)HelperNHibernate.GetEntityByID("Presupuesto", Presupuesto.ID);
         InfoAsistente.Cliente       = InfoAsistente.Presupuesto.Cliente;
         InfoAsistente.FechaCreacion = InfoAsistente.Presupuesto.FechaCreacion;
         udtFechaCreacion.Value      = InfoAsistente.Presupuesto.FechaCreacion;
         FrmSelectedEntity FrmSeleccionarTipoDocumento = new FrmSelectedEntity();
         InfoAsistente.TipoDocumento = (TipoOrdenProduccion)FrmSeleccionarTipoDocumento.GetSelectedEntity(typeof(TipoOrdenProduccion), "Tipo Orden de Producción");
         if (InfoAsistente.TipoDocumento != null)
         {
             ssTipoDocumento.Text      = InfoAsistente.TipoDocumento.Nombre;
             InfoAsistente.Responsable = FrmMain.ObtenerResponsable();
             ssReponsable.Text         = (InfoAsistente.Responsable != null) ? InfoAsistente.Responsable.Nombre : "";
         }
         Mostrar();
     }
     catch (Exception ex)
     {
         SoftException.Control(ex);
     }
 }
Ejemplo n.º 15
0
 public override void Start()
 {
     try
     {
         if (base.m_ItemsSelecteds.Count > 0)
         {
             using (ISession Sesion = m_SessionFactory.OpenSession())
             {
                 Collection ObjectsFlow = new Collection();
                 foreach (String ID in base.m_ItemsSelecteds)
                 {
                     Parent Entity = (Parent)Sesion.Get(base.m_EntidadSF.NombreClase, ID);
                     Entity.NewInstance = false;
                     ObjectsFlow.Add(Entity);
                 }
                 base.m_ObjectFlow    = ObjectsFlow;
                 base.m_ResultProcess = EnumResult.SUCESS;
             }
         }
     }
     catch (Exception ex)
     {
         base.m_ResultProcess = EnumResult.ERROR;
         SoftException.Control(ex);
     }
     base.Start();
 }
        private void ssCotizacion_Search(object sender, EventArgs e)
        {
            try
            {
                if (ActualizandoIU)
                {
                    return;
                }
                String            Filtro          = " IDPresupuesto='" + InfoAsistente.Presupuesto.ID + "'";
                FrmSelectedEntity FrmSeleccionar  = new FrmSelectedEntity();
                ItemPresupuesto   itempresupuesto = (ItemPresupuesto)FrmSeleccionar.GetSelectedEntity(typeof(ItemPresupuesto), "Cotizaciones de Presupuesto", Filtro);

                if (itempresupuesto != null)
                {
                    itempresupuesto = (ItemPresupuesto)HelperNHibernate.GetEntityByID("ItemPresupuesto", itempresupuesto.ID);
                    InfoAsistente.ItemPresupuesto = itempresupuesto;
                    Cotizacion coti = (Cotizacion)HelperNHibernate.GetEntityByID("Cotizacion", InfoAsistente.ItemPresupuesto.IDCotizacion);
                    ssCotizacion.Text = (coti != null) ? coti.Descripcion : "";
                }
            }
            catch (Exception ex)
            {
                SoftException.Control(ex);
            }
        }
        public override void Start()
        {
            using (ISession Sesion = m_SessionFactory.OpenSession())
            {
                using (ITransaction Trans = Sesion.BeginTransaction())
                {
                    try
                    {
                        RendicionCotizacion Rendicion = (RendicionCotizacion)m_ObjectFlow;

                        string sql = string.Format("UPDATE Cotizacion SET EstadoRendicion = 'PENDIENTE' WHERE ID = '{0}'", Rendicion.IDCotizacion);

                        var dbCommand = Sesion.Connection.CreateCommand();
                        Sesion.Transaction.Enlist(dbCommand);
                        dbCommand.CommandText = sql;
                        dbCommand.ExecuteNonQuery();

                        Sesion.Delete(Rendicion);
                        Trans.Commit();
                        m_ResultProcess = EnumResult.SUCESS;
                    }
                    catch (Exception ex)
                    {
                        Trans.Rollback();
                        m_ResultProcess = EnumResult.ERROR;
                        SoftException.Control(ex.InnerException);
                    }
                }
            }
            base.Start();
        }
Ejemplo n.º 18
0
 public override void Start()
 {
     using (ISession Sesion = m_SessionFactory.OpenSession())
     {
         using (ITransaction Trans = Sesion.BeginTransaction())
         {
             try
             {
                 Cotizacion Cotizacion = (Cotizacion)m_ObjectFlow;
                 SqlCommand SqlCmd     = new SqlCommand();
                 SqlCmd.Connection = (SqlConnection)Sesion.Connection;
                 Trans.Enlist(SqlCmd);
                 SqlCmd.CommandText = "pSF_EliminarCotizacion";
                 SqlCmd.CommandType = System.Data.CommandType.StoredProcedure;
                 SqlCmd.Parameters.AddWithValue("@IDSolicitudCotizacion", Cotizacion.IDSolicitudCotizacion);
                 SqlCmd.ExecuteNonQuery();
                 Sesion.Delete(Cotizacion);
                 Trans.Commit();
                 m_ResultProcess = EnumResult.SUCESS;
             }
             catch (Exception ex)
             {
                 Trans.Rollback();
                 m_ResultProcess = EnumResult.ERROR;
                 SoftException.Control(ex.InnerException);
             }
         }
     }
     base.Start();
 }
Ejemplo n.º 19
0
 public void ObtenerCodigoGrupo(InfoAsistenSolicitudCotizacion Info)
 {
     try
     {
         using (ISession Sesion = m_SessionFactory.OpenSession())
         {
             using (ITransaction Trans = Sesion.BeginTransaction())
             {
                 SqlCommand SqlCmd = new SqlCommand();
                 SqlCmd.Connection = (SqlConnection)Sesion.Connection;
                 Trans.Enlist(SqlCmd);
                 SqlCmd.CommandText = "pSF_Obtener_Grupo_SolicitudCotizacion";
                 SqlCmd.CommandType = System.Data.CommandType.StoredProcedure;
                 SqlCmd.Parameters.Add("@CodigoGrupo", SqlDbType.Int).Direction = ParameterDirection.Output;
                 SqlCmd.ExecuteNonQuery();
                 Trans.Commit();
                 Info.CodigoGrupo     = Convert.ToInt32(SqlCmd.Parameters["@CodigoGrupo"].Value);
                 txtCodigoGrupo.Value = Info.CodigoGrupo;
             }
         }
     }
     catch (Exception ex)
     {
         SoftException.Control(ex);
     }
 }
Ejemplo n.º 20
0
 public override void Start()
 {
     using (ISession Sesion = m_SessionFactory.OpenSession())
     {
         using (ITransaction Trans = Sesion.BeginTransaction())
         {
             try
             {
                 Presupuesto Presupuesto = (Presupuesto)m_ObjectFlow;
                 SqlCommand  SqlCmd      = new SqlCommand();
                 SqlCmd.Connection = (SqlConnection)Sesion.Connection;
                 Trans.Enlist(SqlCmd);
                 SqlCmd.CommandText = "pSF_Actualizar_IDPresupuesto_Cotizacion";
                 SqlCmd.CommandType = System.Data.CommandType.StoredProcedure;
                 SqlCmd.Parameters.AddWithValue("@IDPresupuesto", Presupuesto.ID);
                 SqlCmd.Parameters.AddWithValue("@Items", "<Items/>");
                 SqlCmd.ExecuteNonQuery();
                 Sesion.Delete(Presupuesto);
                 Trans.Commit();
                 m_ResultProcess = EnumResult.SUCESS;
             }
             catch (Exception ex)
             {
                 Trans.Rollback();
                 m_ResultProcess = EnumResult.ERROR;
                 SoftException.Control(ex);
             }
         }
     }
     base.Start();
 }
Ejemplo n.º 21
0
        private void ssTipoPresupuesto_Search(object sender, EventArgs e)
        {
            try
            {
                FrmSelectedEntity          FrmSeleccionarTipoDocumento = new FrmSelectedEntity();
                TipoDocumentoConsolidadoOp TipoDocumento = (TipoDocumentoConsolidadoOp)FrmSeleccionarTipoDocumento.GetSelectedEntity(typeof(TipoDocumentoConsolidadoOp), "Tipo Documento Consolidado Op");
                if (TipoDocumento != null)
                {
                    ConsolidadoOp.TipoDocumento = (TipoDocumentoConsolidadoOp)HelperNHibernate.GetEntityByID("TipoDocumentoConsolidadoOp", TipoDocumento.ID);
                    ssTipoConsolidadosOp.Text   = (ConsolidadoOp.TipoDocumento != null) ? ConsolidadoOp.TipoDocumento.Nombre : "";

                    try
                    {
                        FrmSelectedEntity FrmSeleccionarEmpleado = new FrmSelectedEntity();
                        String            filtro = "IDUsuario='" + FrmMain.Usuario.ID + "'";
                        SocioNegocio      sn     = (SocioNegocio)FrmSeleccionarEmpleado.GetSelectedEntity(typeof(SocioNegocio), "Empleado", filtro);

                        ConsolidadoOp.Responsable = (SocioNegocio)HelperNHibernate.GetEntityByID("SocioNegocio", sn.ID);
                        busResponsable.Text       = ConsolidadoOp.Responsable.Nombre;
                    }
                    catch (Exception)
                    {
                    }
                }
                else
                {
                    ssTipoConsolidadosOp.Text = "";
                    busResponsable.Text       = "";
                }
            }
            catch (Exception ex)
            {
                SoftException.Control(ex);
            }
        }
Ejemplo n.º 22
0
        private void ubAgregar_Click(object sender, EventArgs e)
        {
            try
            {
                if (ConsolidadoOp.TipoDocumento == null)
                {
                    throw new Exception("Debe elegir un tipo de Documento");
                }


                if (ConsolidadoOp.Cliente == null)
                {
                    throw new Exception("Debe seleccionar un Cliente");
                }


                Collection        OrdenesProduccion = new Collection();
                FrmSelectedEntity FrmSeleccionar    = new FrmSelectedEntity();
                String            Filtro            = ConsolidadoOp.ObtenerFiltroOPs();
                Filtro            = (Filtro.Length > 0) ? String.Format(" ID NOT IN ({0}) AND IDCliente = '{1}'", Filtro, ConsolidadoOp.Cliente.ID) : String.Format(" IDCliente = '{0}'", ConsolidadoOp.Cliente.ID);
                OrdenesProduccion = FrmSeleccionar.GetSelectedsEntities(typeof(OrdenProduccion), "Selección de Ordenes de Produccion Consolidado", Filtro);
                foreach (OrdenProduccion Item in OrdenesProduccion)
                {
                    ConsolidadoOp.AddItem(Item);
                }
                MostrarItems(true);
            }
            catch (Exception ex)
            {
                SoftException.Control(ex);
            }
        }
Ejemplo n.º 23
0
 private void ssTipoDocumento_Search(object sender, EventArgs e)
 {
     if (ActualizandoUI)
     {
         return;
     }
     try
     {
         try
         {
             FrmSelectedEntity FrmSeleccionar = new FrmSelectedEntity();
             EntradaCaja.TipoDocumento = (TipoCaja)FrmSeleccionar.GetSelectedEntity(typeof(TipoCaja), "Tipo Caja", "Movimiento = 'Entrada'", All: true);
             if (EntradaCaja.TipoDocumento != null)
             {
                 EntradaCaja.GenerarNumeracion();
                 EntradaCaja.Responsable = FrmMain.ObtenerResponsable();
                 Mostrar();
             }
         }
         catch (Exception ex)
         {
             SoftException.Control(ex);
         }
     }
     catch (Exception ex)
     {
         SoftException.ShowException(ex);
     }
 }
Ejemplo n.º 24
0
        public override void Start()
        {
            using (ISession Sesion = m_SessionFactory.OpenSession())
            {
                using (ITransaction Trans = Sesion.BeginTransaction())
                {
                    try
                    {
                        Auditoria   Auditoria   = Auditoria.ConstruirAuditoria(base.m_ObjectFlow, "Creación");
                        Presupuesto Presupuesto = (Presupuesto)m_ObjectFlow;
                        SqlCommand  SqlCmd      = new SqlCommand();
                        SqlCmd.Connection = (SqlConnection)Sesion.Connection;
                        Trans.Enlist(SqlCmd);
                        SqlCmd.CommandText = "pSF_Actualizar_IDPresupuesto_Cotizacion";
                        SqlCmd.CommandType = System.Data.CommandType.StoredProcedure;
                        SqlCmd.Parameters.AddWithValue("@IDPresupuesto", Presupuesto.ID);
                        SqlCmd.Parameters.AddWithValue("@Items", ContruirXML(Presupuesto));
                        SqlCmd.ExecuteNonQuery();

                        if (EstaModificado(Presupuesto))
                        {
                            Presupuesto.EstadoAprobacion = "MODIFICADO";
                        }

                        Sesion.Save(Presupuesto);
                        Sesion.Flush();

                        // Actualizamos la Numeración de la Factura
                        if (Presupuesto.TipoDocumento.GeneraNumeracionAlFinal)
                        {
                            SqlCmd.CommandText = "pSF_Generar_Numeracion";
                            SqlCmd.Parameters.Clear();
                            SqlCmd.Parameters.AddWithValue("@Documento", "Presupuesto");
                            SqlCmd.Parameters.AddWithValue("@TipoDocumento", "TipoPresupuesto");
                            SqlCmd.Parameters.AddWithValue("@IDDocumento", Presupuesto.ID);
                            SqlCmd.Parameters.AddWithValue("@IDTipoDocumento", Presupuesto.TipoDocumento.ID);
                            SqlCmd.ExecuteNonQuery();
                        }


                        Sesion.Save(Auditoria);

                        Trans.Commit();
                        m_ResultProcess = EnumResult.SUCESS;
                    }
                    catch (Exception ex)
                    {
                        Trans.Rollback();
                        m_ResultProcess = EnumResult.ERROR;
                        SoftException.Control(ex);
                    }
                }
            }
            base.Start();
        }
Ejemplo n.º 25
0
 private void txtDescripcion_TextChanged(object sender, EventArgs e)
 {
     try
     {
         TipoCaja.Descripcion = txtDescripcion.Text;
     }
     catch (Exception ex)
     {
         SoftException.Control(ex);
     }
 }
Ejemplo n.º 26
0
 private void udtFechaCreacion_ValueChanged(object sender, EventArgs e)
 {
     try
     {
         InfoAsistente.FechaCreacion = Convert.ToDateTime(udtFechaCreacion.Value);
     }
     catch (Exception ex)
     {
         SoftException.Control(ex);
     }
 }
 private void txtInstruccionesCliente_ValueChanged(object sender, EventArgs e)
 {
     try
     {
         Presupuesto.InstruccionesCliente = txtInstruccionesCliente.Text;
     }
     catch (Exception ex)
     {
         SoftException.Control(ex);
     }
 }
Ejemplo n.º 28
0
 private void cboMovimiento_ValueChanged(object sender, EventArgs e)
 {
     try
     {
         TipoCaja.Movimiento = cboMovimiento.Text;
     }
     catch (Exception ex)
     {
         SoftException.Control(ex);
     }
 }
Ejemplo n.º 29
0
 private void uceTipoDeuda_ValueChanged(object sender, EventArgs e)
 {
     try
     {
         TipoNotaDebito.TipoDeuda = uceTipoDeuda.Text;
     }
     catch (Exception ex)
     {
         SoftException.Control(ex);
     }
 }
Ejemplo n.º 30
0
 private void txtObservacion_TextChanged(object sender, EventArgs e)
 {
     try
     {
         SolicitudCotizacion.Observacion = txtObservacion.Text;
     }
     catch (Exception ex)
     {
         SoftException.Control(ex);
     }
 }