Example #1
0
        protected void MontarCnt(string calificadorControl6069, string valorControl6066)
        {
            var cnt = new CNT(new ControlDeTotales(calificadorControl6069, valorControl6066, null));

            Segmentos.Add(cnt);
            Mensaje += cnt.getSegmento();
        }
Example #2
0
        protected void MontarMoa(string calificadorTipoImporte5025, string importeMonetario5004)
        {
            var moa = new MOA(new ImporteMonetario(calificadorTipoImporte5025, importeMonetario5004, _monedaCodificada, null, null));

            Segmentos.Add(moa);
            Mensaje += moa.getSegmento();
        }
Example #3
0
        protected void MontarUns(string identificacionDeSeccion0081)
        {
            var uns = new UNS(identificacionDeSeccion0081);

            Segmentos.Add(uns);
            Mensaje += uns.getSegmento();
        }
Example #4
0
        protected void MontarRff(string numeroReferencia1154)
        {
            var rff = new RFF(new Referencia(_calificadorReferencia_1153, numeroReferencia1154, null, null));

            Segmentos.Add(rff);
            Mensaje += rff.getSegmento();
        }
Example #5
0
 public ActionResult Edit(Segmentos data, bool continueAdd, bool isDelete)
 {
     if (!isDelete)
     {
         if (ModelState.IsValid)
         {
             db.Entry(data).State = EntityState.Modified;
             db.SaveChanges();
             return(continueAdd ? RedirectToAction("Edit", new { id = data.segmentoid }) : RedirectToAction("List"));
         }
         return(View(data));
     }
     else
     {
         try
         {
             Segmentos dataDelete = db.Segmentos.Find(data.segmentoid);
             db.Segmentos.Remove(dataDelete);
             db.SaveChanges();
             RedirectToAction("List");
         }
         catch (DbEntityValidationException e)
         {
             //foreach (var result in e.EntityValidationErrors)
             // {
             //   foreach (var error in result.ValidationErrors)
             // {
             ModelState.AddModelError("", e.Message);
             //}
             // }
             return(RedirectToAction("Edit", new { id = data.segmentoid }));
         }
         return(RedirectToAction("List"));
     }
 }
Example #6
0
        public void ConsultaSegmento_Usuario(ref List <Segmentos> list, int Id_Emp, int?Id_U, string Conexion)
        {
            try
            {
                SqlDataReader      dr        = null;
                CapaDatos.CD_Datos CapaDatos = new CapaDatos.CD_Datos(Conexion);

                string[] Parametros = { "@Id_Emp", "@Id_U" };
                object[] Valores    = { Id_Emp, Id_U };

                SqlCommand sqlcmd = CapaDatos.GenerarSqlCommand("spCatSegmentosUsuario_Consultar", ref dr, Parametros, Valores);

                Segmentos segmento;
                while (dr.Read())
                {
                    segmento             = new Segmentos();
                    segmento.Id_Seg      = (int)dr.GetValue(dr.GetOrdinal("Id_Seg"));
                    segmento.Descripcion = (string)dr.GetValue(dr.GetOrdinal("Seg_Descripcion"));
                    segmento.Id_U        = dr.IsDBNull(dr.GetOrdinal("Id_U")) ? (int?)null : dr.GetInt32(dr.GetOrdinal("Id_U"));
                    list.Add(segmento);
                }

                CapaDatos.LimpiarSqlcommand(ref sqlcmd);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #7
0
        protected void MontarUnt(string numeroSegmentosMensaje0074, string numeroReferenciaMensaje0062)
        {
            var unt = new UNT(numeroSegmentosMensaje0074, numeroReferenciaMensaje0062);

            Segmentos.Add(unt);
            Mensaje += unt.getSegmento();
        }
Example #8
0
        public ActionResult Edit(Segmentos objeto)
        {
            try
            {
                Segmentos.TransactionInstance.Save(objeto);

                return RedirectToAction("Index", new { displayMessage = MENSAGEM_ALTERACAO });
            }
            catch (ApplicationException ex)
            {
                string[] campos = ex.Message.Split(',');
                ModelState.AddModelError(string.Empty, MENSAGEM_CAMPOS_OBRIGATORIOS);
                foreach (string campo in campos)
                {
                    ModelState[campo].Errors.Add(ex);
                }

                return View(objeto);
            }
            catch (Exception ex)
            {
                ModelState.AddModelError(string.Empty, ex.Message);

                return View(objeto);
            }
        }
Example #9
0
        protected void MontarCstCabecera(string codigoIdentificacionAduanera7361, string calificadorListaCodigos1131)
        {
            var cst = new CST(null,
                              new CodigoIdentificacionAduanera(codigoIdentificacionAduanera7361, calificadorListaCodigos1131, null));

            Segmentos.Add(cst);
            Mensaje += cst.getSegmento();
        }
Example #10
0
        protected void MontarTod(string plazoEntregaCodificado4053)
        {
            var tod = new TOD(null, null,
                              new PlazoEntrega(plazoEntregaCodificado4053, null, null, null, null));

            Segmentos.Add(tod);
            Mensaje += tod.getSegmento();
        }
Example #11
0
        protected void MontarGis(string indicadorProcesoCodificado7365, string calificadorListaCodigosCodificado1131)
        {
            var dtm = new GIS(new IndicadorDeProceso(indicadorProcesoCodificado7365, calificadorListaCodigosCodificado1131,
                                                     null, null));

            Segmentos.Add(dtm);
            Mensaje += dtm.getSegmento();
        }
Example #12
0
        protected void MontarUnz(string referenciaControlIntercambio)
        {
            var refControl = CleanText(referenciaControlIntercambio);

            var unz = new UNZ(refControl, _cuentaControlIntercambio_0036);

            Segmentos.Add(unz);
            Mensaje += unz.getSegmento();
        }
Example #13
0
        protected void MontarLoc(string calificadorDeLugar3227, string identificacionLugar)
        {
            var loc = new LOC(calificadorDeLugar3227,
                              new IdentificacionLugar(identificacionLugar, null, null, null),
                              null, null, null);

            Segmentos.Add(loc);
            Mensaje += loc.getSegmento();
        }
Example #14
0
        protected void MontarMea(string calificadorAplicacionMedida6311, string calificadorUnidadMedida6411, string valorMedida6314)
        {
            var mea = new MEA(calificadorAplicacionMedida6311, null,
                              new ValorAmplitud(calificadorUnidadMedida6411, valorMedida6314, null, null),
                              null);

            Segmentos.Add(mea);
            Mensaje += mea.getSegmento();
        }
Example #15
0
        //
        // GET: /TipoLead/Edit/5
        public ActionResult Edit(int id)
        {
            Segmentos data = db.Segmentos.Find(id);

            if (data == null)
            {
                return(InvokeHttpNotFound());
            }
            return(View(data));
        }
Example #16
0
        protected void MontarTdt(string modoTransporteCodificado8067)
        {
            var tdt = new TDT(_calificadorRutaTransporte_8051, null,
                              new ModoTransporte(modoTransporteCodificado8067, null),
                              null, null, null, null, null);


            Segmentos.Add(tdt);
            Mensaje += tdt.getSegmento();
        }
Example #17
0
        protected void MontarDtm(string calificadorFecha2005, string fechaHora)
        {
            var _calificadorFecha = CleanText(calificadorFecha2005);
            var _fechaHora        = CleanText(fechaHora);

            var dtm = new DTM(new FechaHoraPeriodo(_calificadorFecha, _fechaHora, null));

            Segmentos.Add(dtm);
            Mensaje += dtm.getSegmento();
        }
Example #18
0
        protected override void MontarNad(string calificadorDeEntidad3035, string identificacionEntidadCodificada3039, string nombreEntidad)
        {
            var _idEntidadCod = CleanText(identificacionEntidadCodificada3039);
            var _nomEntidad   = CleanText(nombreEntidad);

            var nad = new NAD(calificadorDeEntidad3035, new IdentificacionDeLaParte(_idEntidadCod, null, null),
                              null, _nomEntidad, null, null, null, null, null);

            Segmentos.Add(nad);
            Mensaje += nad.getSegmento();
        }
Example #19
0
 public void ModificarSegmentos(Segmentos segmento, string Conexion, ref int verificador)
 {
     try
     {
         CD_CatSegmentos claseCapaDatos = new CD_CatSegmentos();
         claseCapaDatos.ModificarSegmentos(segmento, Conexion, ref verificador);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #20
0
        protected void MontarCstPartidas(string numeroPartida, string codigoIdentificacionAduanera7361,
                                         string naturalezaTransaccion, string regimenEstadistico)
        {
            var cst = new CST(numeroPartida,
                              new CodigoIdentificacionAduanera(codigoIdentificacionAduanera7361, _calificadorListaCodigosMercancia, null),
                              null,
                              new CodigoIdentificacionAduanera(naturalezaTransaccion, _calificadorListaCodigosNaturalezaTransaccion, null),
                              new CodigoIdentificacionAduanera(regimenEstadistico, _calificadorListaCodigosRegimenEstadistico, null),
                              null);

            Segmentos.Add(cst);
            Mensaje += cst.getSegmento();
        }
Example #21
0
        protected override void MontarBgm(string numeroDocumento1004, string codigoDeFuncionDelMensaje1225)
        {
            var numDocumento   = CleanText(numeroDocumento1004);
            var codFuncMensaje = CleanText(codigoDeFuncionDelMensaje1225);

            var bgm = new BGM(new DocumentoDelMensaje(_nombreDocumentoCodificado_1001, null, null, null),
                              numDocumento,
                              codFuncMensaje,
                              null);

            Segmentos.Add(bgm);
            Mensaje += bgm.getSegmento();
        }
Example #22
0
        protected override void MontarUnh(string numeroReferenciaMensaje)
        {
            var _numeroReferencia = CleanText(numeroReferenciaMensaje);

            var unh = new UNH(_numeroReferencia,
                              new IdentificadorDelMensaje(_idTipoMensaje_0065, _numeroVersionTipoMensaje_0052,
                                                          _numeroPublicacionTipoMensaje_0054, _agenciaControladora_0051,
                                                          _codigoAsignadoDeAsociacion_0057),
                              null, null);

            Segmentos.Add(unh);
            Mensaje += unh.getSegmento();
        }
Example #23
0
        public ActionResult Create(Segmentos data, bool continueAdd, FormCollection form)
        {
            ModelState.Clear();
            data.segmentoid = db.Database.SqlQuery <Int32>("select Segmentos_Seq.NextVal from dual ").FirstOrDefault <Int32>();

            TryValidateModel(data);
            if (ModelState.IsValid)
            {
                db.Segmentos.Add(data);
                db.SaveChanges();
                return(continueAdd ? RedirectToAction("Create") : RedirectToAction("List"));
            }
            return(View(data));
        }
Example #24
0
        protected void MontarUnb(string idEmisor, string referenciaControlIntercambio0020, bool indicadorPrueba)
        {
            var _idEmisor  = CleanText(idEmisor);
            var refControl = CleanText(referenciaControlIntercambio0020);

            var unb = new UNB(new IdentificadorDeSintaxis(_identificadorSintaxis_0001, _numeroVersionSintaxis_0002),
                              new EmisorDelIntercambio(_idEmisor, _codCalificadorIdentificacionParticipante_0007, null),
                              new ReceptorDelIntercambio(_idReceptor_0010, _codCalificadorIdentificacionParticipante_0007, null),
                              refControl,
                              null, null, null, null, null, true);

            Segmentos.Add(unb);
            Mensaje += unb.getSegmento();
        }
Example #25
0
 internal override void FromXml(XmlNode node)
 {
     if (node == null)
     {
         return;
     }
     foreach (XmlNode childNode in node.ChildNodes)
     {
         if (childNode.Name != "SEGMENTO")
         {
             continue;
         }
         Segmentos.Add(Segmento.FromXml(childNode));
     }
 }
Example #26
0
        public void ConsultaSegmentos(int Id_Emp, int Id_Seg, string Conexion, ref List <Segmentos> List)
        {
            try
            {
                SqlDataReader      dr        = null;
                CapaDatos.CD_Datos CapaDatos = new CapaDatos.CD_Datos(Conexion);

                string[] Parametros = { "@Id_Emp", "@Id_seg" };
                object[] Valores    = { Id_Emp, Id_Seg };

                SqlCommand sqlcmd = CapaDatos.GenerarSqlCommand("spCatSegmentos_Consulta", ref dr, Parametros, Valores);

                Segmentos segmento;
                while (dr.Read())
                {
                    segmento             = new Segmentos();
                    segmento.Id_Emp      = (int)dr.GetValue(dr.GetOrdinal("Id_Emp"));
                    segmento.Id_Seg      = (int)dr.GetValue(dr.GetOrdinal("Id_Seg"));
                    segmento.Descripcion = (string)dr.GetValue(dr.GetOrdinal("Seg_Descripcion"));
                    segmento.Id_UEN      = (int)dr.GetValue(dr.GetOrdinal("Id_Uen"));
                    segmento.Unidades    = (string)dr.GetValue(dr.GetOrdinal("Seg_Unidades"));
                    segmento.Valor       = (double)dr.GetValue(dr.GetOrdinal("Seg_ValUniDim"));
                    segmento.Estatus     = Convert.ToBoolean(dr.GetValue(dr.GetOrdinal("Seg_Activo")));
                    if (Convert.ToBoolean(segmento.Estatus))
                    {
                        segmento.EstatusStr = "Activo";
                    }
                    else
                    {
                        segmento.EstatusStr = "Inactivo";
                    }
                    List.Add(segmento);
                }

                CapaDatos.LimpiarSqlcommand(ref sqlcmd);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #27
0
 public bool AddSegmento(string IDSegmento, string Descripcion, string SecuenciaSegmento, string TiempoDeRespuesta)
 {
     using (PLMContext db = new PLMContext())
     {
         var Segmento = new Segmentos();
         Segmento.IdSegmento        = IDSegmento;
         Segmento.DescripciĆ³n       = Descripcion;
         Segmento.TiempoDeRespuesta = int.Parse(TiempoDeRespuesta);
         Segmento.SecuenciaSegmento = int.Parse(SecuenciaSegmento);
         try
         {
             db.Segmentos.Add(Segmento);
             db.SaveChanges();
             return(true);
         }
         catch (Exception ex)
         {
             Dialogs.Show(ex.Message, DialogsType.Error);
             return(false);
         }
     }
 }
Example #28
0
 public void ModificarSegmentos(Segmentos segmentos, string Conexion, ref int verificador)
 {
     try
     {
         CapaDatos.CD_Datos CapaDatos  = new CapaDatos.CD_Datos(Conexion);
         string[]           Parametros =
         {
             "@Id_Emp",
             "@Id_Seg",
             "@Id_Seg_Ant",
             "@Seg_Descripcion",
             "@Id_Uen",
             "@Seg_Unidades",
             "@Seg_ValUniDim",
             "@Id_U",
             "@Seg_Activo"
         };
         object[] Valores =
         {
             segmentos.Id_Emp,
             segmentos.Id_Seg,
             segmentos.Id_Seg_Ant,
             segmentos.Descripcion,
             segmentos.Id_UEN,
             segmentos.Unidades,
             segmentos.Valor,
             segmentos.Id_U,
             segmentos.Estatus
         };
         SqlCommand sqlcmd = CapaDatos.GenerarSqlCommand("spCatSegmentos_Modificar", ref verificador, Parametros, Valores);
         CapaDatos.LimpiarSqlcommand(ref sqlcmd);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #29
0
        public ActionResult Remove(Segmentos objeto)
        {
            Segmentos.TransactionInstance.Remove(objeto);

            return RedirectToAction("Index", new { displayMessage = MENSAGEM_EXCLUSAO });
        }
        public void AgregarPuntos(PointF a, PointF b)
        {
            Segmentos p = new Segmentos(a, b);

            Puntos.Add(p);
        }
        private void Guardar()
        {
            try
            {
                Sesion session = new Sesion();
                session = (Sesion)Session["Sesion" + Session.SessionID];
                Segmentos segmento = new Segmentos();
                segmento.Id_Seg      = Convert.ToInt32(txtClave.Text);
                segmento.Descripcion = txtDescripcion.Text;
                segmento.Id_Emp      = session.Id_Emp;
                segmento.Id_UEN      = Convert.ToInt32(this.cmbUEN.SelectedValue);
                segmento.Unidades    = txtUnidades.Text;
                segmento.Valor       = txtValor.Text == string.Empty ? 0 : Convert.ToDouble(txtValor.Text);
                segmento.Id_U        = session.Id_U;
                segmento.Estatus     = chkActivo.Checked;
                CN_CatSegmentos clsCatSegmentos = new CN_CatSegmentos();
                int             verificador     = -1;

                if (HF_ID.Value == "")
                {
                    if (!_PermisoGuardar)
                    {
                        Alerta("No tiene permisos para grabar");
                        return;
                    }
                    clsCatSegmentos.InsertarSegmentos(segmento, session.Emp_Cnx, ref verificador);
                    if (verificador == 1)
                    {
                        Nuevo();
                        Alerta("Los datos se guardaron correctamente");
                    }
                    else
                    {
                        Alerta("La clave ya existe");
                    }
                }
                else
                {
                    if (!_PermisoModificar)
                    {
                        Alerta("No tiene permisos para modificar");
                        return;
                    }
                    segmento.Id_Seg_Ant = Convert.ToInt32(HF_ID.Value);
                    clsCatSegmentos.ModificarSegmentos(segmento, session.Emp_Cnx, ref verificador);
                    if (verificador == 1)
                    {
                        Alerta("Los datos se modificaron correctamente");
                    }
                    else
                    {
                        Alerta("OcurriĆ³ un error al intentar modificar los datos");
                    }
                }
                rg1.Rebind();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #32
0
 private void loadInteraccionActual()
 {
     Motivos        = ModelHelper.GetMotivosByIDTipoInteraccion(InteraccionActual.TipoInteraccion.IdTipoInteraccion);
     SegmentoActual = (InteraccionActual.Negocio == null) ? null : Segmentos.Where((s) => s.IdSegmento == InteraccionActual.Negocio.IdSegmento).FirstOrDefault() as SegmentoModel;
     ConfigureView();
 }