protected void ingresar(object sender, EventArgs e)
        {
            Inserts cargar = new Inserts();

            cargar.llenar_usuarios();
            Usuario uc = Globales.listausuario.Find(x => x.getLogin() == inputnombre.Text);

            if (uc != null)
            {
                for (int i = 0; i < Globales.listausuario.Count; i++)
                {
                    if ((Globales.listausuario[i].getLogin() == inputnombre.Text) && (Globales.listausuario[i].getContra() == inputcontrasenna.Text) && (Globales.listausuario[i].getrol() == "Admin"))
                    {
                        if (Globales.listausuario[i].getlogeado() == "false")
                        {
                            Server.Transfer("DefaultAdmin.aspx");
                            Globales.listausuario[i].setlogeado("true");
                        }
                    }
                    if ((Globales.listausuario[i].getLogin() == inputnombre.Text) && (Globales.listausuario[i].getContra() == inputcontrasenna.Text) && (Globales.listausuario[i].getrol() == "Cliente"))
                    {
                        if (Globales.listausuario[i].getlogeado() == "false")
                        {
                            Server.Transfer("Default.aspx");
                            Globales.listausuario[i].setlogeado("true");
                        }
                    }
                }
            }
        }
        protected void registrarme(object sender, EventArgs e)
        {
            Usuario u = new Usuario(inputnombrere.Text, inputnombrelogin.Text, inputconfirmacontra.Text, inputemail.Text, direccion.Text, int.Parse(inputcedula.Text), int.Parse(inputtelefono.Text), "false", "Cliente");

            Globales.listausuario.Add(u);
            Inserts nuevou = new Inserts();

            nuevou.insertar_usuario(u);
        }
示例#3
0
        private void AddInsertSetting(string columnName, object columnValue, DbType dbType, bool isExpression)
        {
            InsertSetting setting = new InsertSetting();

            setting.ColumnName    = columnName;
            setting.ParameterName = Utility.PrefixParameter("ins_" + columnName, provider);
            setting.Value         = columnValue;
            setting.IsExpression  = isExpression;
            setting.DataType      = dbType;
            Inserts.Add(setting);
        }
            public Insert Insert(int position)
            {
                Insert insert;

                if (!Inserts.TryGetValue(position, out insert))
                {
                    Inserts[position] = insert = new Insert();
                }

                return(insert);
            }
示例#5
0
        private void AddInsertSetting(string columnName, object columnValue, DbType dbType, bool isExpression)
        {
            InsertSetting setting = new InsertSetting
            {
                ColumnName    = columnName,
                ParameterName = provider.FormatParameterNameForSQL("ins_" + columnName),
                Value         = columnValue,
                IsExpression  = isExpression,
                DataType      = dbType
            };

            Inserts.Add(setting);
        }
示例#6
0
 public void Add(SqlSearchCondition?when, SqlInsertClause insert)
 => Inserts.Add(new SqlConditionalInsertClause(insert, when));
示例#7
0
        public string confirmarOdt(confirmarODTRequest request)
        {
            var mensaje = "";
            var val     = "";
            var estado  = "";

            if (request == null)
            {
                throw new ArgumentNullException("Request");
            }
            try
            {
                Updates    update     = new Updates();
                Inserts    insert     = new Inserts();
                Procedures procedures = new Procedures();

                insert.onbaseinboxconfirmacion(request);

                var      idproveedor    = (from a in contex_.C_PROVEEDORES_USUARIOS where a.DESC_PROVEEDOR_USUARIO == request.Proveedor select a.ID_PROVEEDOR_USUARIO).FirstOrDefault();
                var      descProveedor  = (from a in contex_.C_PROVEEDORES_USUARIOS where a.ID_PROVEEDOR_USUARIO == idproveedor select a.DESC_PROVEEDOR_USUARIO).FirstOrDefault();
                var      sepomex        = (from f in contex_.SEPOMEX join g in contex_.SEPOMEX_ESTADOS on f.d_estado equals g.ID_ESTADO where f.d_CP == request.Cp.TrimEnd() select g.ESTADO).FirstOrDefault();
                var      idconectividad = (from b in contex_.C_CONECTIVIDAD where b.DESC_CONECTIVIDAD.Trim().Equals(request.Conectividad.Trim()) && b.ID_CLIENTE == 4 && b.STATUS == "ACTIVO" select b.ID_CONECTIVIDAD).FirstOrDefault();
                var      existCP        = (from a in contex_.BD_TIPO_PLAZA_CLIENTE_CP where a.CP == request.Cp select a).FirstOrDefault();
                string[] tipoabArray    = { "A", "b", "a", "B" };
                int?     idtipoEquipo   = null;
                //DateTime FECHA_INICIO = new DateTime();
                if (tipoabArray.Any(request.TipoAB.Contains))
                {
                    idtipoEquipo = (from c in contex_.C_TIPO_A_B where c.DESC_TIPO_A_B == request.TipoAB.ToUpper() || c.DESC_TIPO_A_B == request.TipoAB.ToLower() select c.ID_TIPO_A_B).FirstOrDefault();
                }


                if (sepomex == null || sepomex == "")
                {
                    mensaje = "El codigo postal no existe en la base de sepomex";
                    insert.logws(request.PreOdt, "ERROR", mensaje);
                    return(mensaje);
                }

                if (existCP == null)
                {
                    mensaje = "NO SE ENCUENTRA ZONA POR CODIGO POSTAL";
                    insert.logws(request.PreOdt, "ERROR", mensaje);
                    return(mensaje);
                }

                if (sepomex.ToUpper() != RemoveAccentsWithNormalization(request.Estado.ToString().ToUpper()))
                {
                    var existeEstado = (from A in contex_.BD_EQUIVALENCIA_ESTADO where A.DESC_ESTADO == RemoveAccentsWithNormalization(request.Estado.ToUpper()) select A.DESC_ESTADO_EQUIVALENCIA).FirstOrDefault();
                    if (sepomex != existeEstado)
                    {
                        mensaje = "ERROR EN DATOS DEMOGRAFICOS";
                        insert.logws(request.PreOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    estado = existeEstado;

                    /*
                     * request.Estado = existeEstado;*/
                }
                else
                {
                    estado = null;
                }

                var status = new int?[] { 3, 6, 7, 8 };

                var arstatus = (from a in contex_.BD_AR where a.NO_AR == request.PreOdt && status.Contains(a.ID_STATUS_AR) select a).FirstOrDefault();

                var ar = (from a in contex_.BD_AR where a.NO_AR == request.PreOdt && a.ID_STATUS_AR == 32 select a).FirstOrDefault();

                if (ar == null && arstatus != null)
                {
                    mensaje = "La Odt ya existe en el sistema";
                    insert.logws(request.PreOdt, "ERROR", mensaje);
                    return(mensaje);
                }

                if (ar == null)
                {
                    mensaje = "La PreOdt no existe en el sistema";
                    insert.logws(request.PreOdt, "ERROR", mensaje);
                    return(mensaje);
                }
                if (request.Afiliacion == "" || request.Afiliacion == "0")
                {
                    mensaje = "El campo afiliacion no debe venir vacio o en cero";
                    insert.logws(request.PreOdt, "ERROR", mensaje);
                    return(mensaje);
                }
                if (request.Colonia == "")
                {
                    mensaje = "El campo de Colinia no puede venir vacio";
                    insert.logws(request.PreOdt, "ERROR", mensaje);
                    return(mensaje);
                }
                if (request.Poblacion == "")
                {
                    mensaje = "El campo de poblacion no puede estar vacio";
                    insert.logws(request.PreOdt, "ERROR", mensaje);
                    return(mensaje);
                }
                if (request.Estado == "")
                {
                    mensaje = "El campo de Estado no puede estar vacio";
                    insert.logws(request.PreOdt, "ERROR", mensaje);
                    return(mensaje);
                }
                if (request.Cp.Length > 5 || request.Cp.Length < 4)
                {
                    mensaje = "El campo CP debe tener minimo 4 digitos maximo 5";
                    insert.logws(request.PreOdt, "ERROR", mensaje);
                    return(mensaje);
                }
                if (request.Proveedor == "")
                {
                    mensaje = "El campo de proveedor no puede estar vacio";
                    insert.logws(request.PreOdt, "ERROR", mensaje);
                    return(mensaje);
                }

                /*
                 * if (request.Producto == "")
                 * {
                 *  mensaje = "El campo de producto no puede estar vacio";
                 *  insert.logws(request.PreOdt, "ERROR", mensaje);
                 *  return mensaje;
                 * }*/
                if (request.EjecutivoKA == "")
                {
                    mensaje = "El campo de EjecutivoKA no puede estar vacio";
                    insert.logws(request.PreOdt, "ERROR", mensaje);
                    return(mensaje);
                }
                if (request.EmailEjecutivoKA == "")
                {
                    mensaje = "El campo de EmailEjecutivoKA no puede estar vacio";
                    insert.logws(request.PreOdt, "ERROR", mensaje);
                    return(mensaje);
                }
                if (request.EjecutivoSucursal == "")
                {
                    mensaje = "El campo de EjecutivoSucursal no puede estar vacio";
                    insert.logws(request.PreOdt, "ERROR", mensaje);
                    return(mensaje);
                }
                if (request.Sucursal == "")
                {
                    mensaje = "El campo de Sucursal no puede estar vacio";
                    insert.logws(request.PreOdt, "ERROR", mensaje);
                    return(mensaje);
                }
                if (request.TelEjecutivo == "")
                {
                    mensaje = "El campo de TelEjecutivo no puede estar vacio";
                    insert.logws(request.PreOdt, "ERROR", mensaje);
                    return(mensaje);
                }
                if (request.TelSucursal == "")
                {
                    mensaje = "El campo de TelSucursal no puede estar vacio";
                    insert.logws(request.PreOdt, "ERROR", mensaje);
                    return(mensaje);
                }
                if (request.ContactoComercio == "")
                {
                    mensaje = "El campo de ContactoComercio no puede estar vacio";
                    insert.logws(request.PreOdt, "ERROR", mensaje);
                    return(mensaje);
                }
                if (request.Descripcion == "")
                {
                    mensaje = "El campo de Descripcion no puede estar vacio";
                    insert.logws(request.PreOdt, "ERROR", mensaje);
                    return(mensaje);
                }
                if (request.Telefono == "")
                {
                    mensaje = "El campo de Telefono no puede estar vacio";
                    insert.logws(request.PreOdt, "ERROR", mensaje);
                    return(mensaje);
                }
                if (request.Proyecto == "")
                {
                    mensaje = "El campo de Proyecto no puede estar vacio";
                    insert.logws(request.PreOdt, "ERROR", mensaje);
                    return(mensaje);
                }
                if (idproveedor == 0)
                {
                    return(mensaje = "El proveedor ingresado no existe");
                }

                //nuevas validaciones para campos nuevos de afiliacionAmex y idAmex

                if (request.AfilAmex.Length > 17)
                {
                    mensaje = "El campo Afiliacion Amex debe contener 17 numeros con opcion de completar con 7 caracteres de texto";
                    insert.logws(request.PreOdt, "ERROR", mensaje);
                    return(mensaje);
                }
                if (request.IdAmex.Length > 17)
                {
                    mensaje = "El campo Id Amex debe contener 17 numeros con opcion de completar con 7 caracteres de texto";
                    insert.logws(request.PreOdt, "ERROR", mensaje);
                    return(mensaje);
                }

                //


                ar.NO_AR         = request.PreOdt;
                ar.NO_AFILIACION = request.Afiliacion;
                ar.COLONIA       = request.Colonia;
                //ar.SINTOMA = request.Descripcion;
                ar.BITACORA  = request.Descripcion;
                ar.TELEFONO  = request.Telefono;
                ar.COLONIA   = request.Colonia;
                ar.POBLACION = request.Poblacion;
                if (estado != null)
                {
                    ar.ESTADO = estado;
                }
                else
                {
                    ar.ESTADO = request.Estado;
                }
                ar.CP                  = request.Cp.Trim();
                ar.CAJA                = request.IdCaja;
                ar.ID_PROVEEDOR        = idproveedor;
                ar.ID_TECNICO          = null;
                ar.CODIGO_INTERVENCION = request.TelSucursal;
                ar.OTORGANTE_TAS       = request.Contacto1;
                ar.TELEFONO_COMERCIO   = request.Contacto2;
                ar.MOTIVO_RETIPIFICADO = request.EmailServ;
                ar.MOTIVO_COBRO        = request.ReferenciaUbicacion;
                ar.DESC_EQUIPO         = request.ModeloTPV;
                ar.FEC_INICIO          = DateTime.Now;
                ar.FEC_ALTA            = DateTime.Now;
                if (idtipoEquipo != null)
                {
                    ar.ID_TIPO_EQUIPO = idtipoEquipo;
                }
                if (idconectividad != 0)
                {
                    ar.ID_CONECTIVIDAD = idconectividad;
                }
                if (request.Proyecto.ToUpper().Equals("SI") || request.Proyecto.ToUpper().Equals("SÍ"))
                {
                    ar.ID_PROYECTO = 1;
                }
                else
                {
                    ar.ID_PROYECTO = 0;
                }
                if (request.Producto != "")
                {
                    var idproducto = (from e in contex_.C_PRODUCTOS_NEGOCIOS where e.DESC_PRODUCTO_NEGOCIO == request.Producto select e.ID_PRODUCTO_NEGOCIO).SingleOrDefault();
                    ar.ID_PRODUCTO = idproducto;
                }
                if (request.FolioTelecarga != "")
                {
                    ar.FOLIO_TELECARGA = request.FolioTelecarga;
                    ar.EQUIPO          = request.FolioTelecarga;
                }
                //ingresar variables nuevas
                var AfilAmexV = request.AfilAmex;
                var IdAmex    = request.IdAmex;
                //
                ar.OTORGANTE_SOPORTE_CLIENTE = request.EjecutivoSucursal;
                ar.SINTOMA = request.Sintoma;
                ar.STATUS  = "PROCESADO";
                contex_.SubmitChanges();
                var idar = ar.ID_AR;
                insert.terminalAmex(idar, IdAmex, AfilAmexV);
                procedures.actualizarOdt(idar);
                update.arStatus(idar, 3);
                insert.bitacoraAr(idar, 32, 3, "Solicitud de servicio Asignada");

                mensaje = "ODT REGISTRADA:" + ar.NO_AR;
                val     = "EXITO CONFIRMACION";
            }
            catch (Exception ex)
            {
                mensaje = ex.Message;
                val     = "ERROR CONFIRMACION";
            }
            Inserts inserts = new Inserts();

            inserts.logws(request.PreOdt, val, mensaje);
            return(mensaje);
        }
示例#8
0
        public string addServicio(addODTRequest odt)
        {
            var mensaje = "";
            var val     = "";

            if (odt == null)
            {
                throw new ArgumentNullException("ODT");
            }
            try
            {
                Inserts insert = new Inserts();
                insert.onbaseinbox(odt);
                if (odt.FolioTelecarga == "0" || odt.FolioTelecarga == "")
                {
                    Regex    reg         = new Regex("[^a-zA-Z0-9 ]");
                    string[] desc        = odt.Producto.Split('-');
                    var      idsegmento  = (from aa in contex_.BD_NEGOCIOS where aa.NO_AFILIACION == odt.Afiliacion && aa.ID_CLIENTE == 4 select aa.ID_SEGMENTO).FirstOrDefault();
                    var      idservicio  = (from a in contex_.C_SERVICIOS where a.DESC_SERVICIO == reg.Replace(odt.TipoServicio.Normalize(NormalizationForm.FormD), "") && a.ID_CLIENTE == 4 && a.STATUS == "ACTIVO" select a.ID_SERVICIO).FirstOrDefault();
                    var      idfalla     = (from b in contex_.C_FALLAS where b.DESC_FALLA == reg.Replace(odt.SubtipoServicio.Normalize(NormalizationForm.FormD), "") && b.ID_CLIENTE == 4 && b.STATUS == "ACTIVO" select b.ID_FALLA).FirstOrDefault();
                    var      idproveedor = (from c in contex_.C_PROVEEDORES_USUARIOS where c.DESC_PROVEEDOR_USUARIO == odt.Proveedor select c.ID_PROVEEDOR_USUARIO).FirstOrDefault();
                    var      idarunico   = (from d in contex_.BD_CARGAS join e in contex_.C_CLIENTES on d.ID_CLIENTE equals e.ID_CLIENTE where e.ID_CLIENTE == 4 select new { isarunico = e.IS_AR_UNICO == null ? 0 : e.IS_AR_UNICO }).FirstOrDefault();
                    var      idproducto  = (from e in contex_.C_PRODUCTOS_NEGOCIOS where e.DESC_PRODUCTO_NEGOCIO == odt.Producto select e.ID_PRODUCTO_NEGOCIO).SingleOrDefault();

                    if (idsegmento == null)
                    {
                        idsegmento = 0;
                    }

                    if (odt.ArOdt == "")
                    {
                        mensaje = "El campo de ODT no puede estar vacio";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    if (odt.Descripcion == "")
                    {
                        mensaje = "El campo descripcion no puede estar vacio";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    if (odt.Observacion == "")
                    {
                        mensaje = "El campo observacion no puede estar vacio";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    if (odt.Comercio == "")
                    {
                        mensaje = "El campo comercio no puede estar vacio";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    if (odt.Domicilio == "")
                    {
                        mensaje = "El campo domicilio no puede estar vacio";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    if (odt.Colonia == "")
                    {
                        mensaje = "El campo colonia no puede estar vacio";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    if (odt.Poblacion == "")
                    {
                        mensaje = "El campo poblacion no puede estar vacio";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    if (odt.Estado == "")
                    {
                        mensaje = "El campo estado no puede estar vacio";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    if (odt.Cp == "")
                    {
                        mensaje = "El campo CP no puede estar vacio";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    if (odt.RazonSocial == "")
                    {
                        mensaje = "El campo Razon Social no puede estar vacio";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    if (odt.Rfc == "")
                    {
                        mensaje = "El campo RFC no puede estar vacio";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    if (odt.Proveedor == "")
                    {
                        mensaje = "El campo proveedor no puede estar vacio";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    if (odt.FechaEnvio == "")
                    {
                        mensaje = "El campo Fecha Envio no puede estar vacio";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    //se descomentan lineas para uso de idamex y afiliacion

                    /* if(odt.AfilAmex.Length < 10 || odt.AfilAmex.Length > 10)
                     * {
                     *   mensaje = "El campo Afiliacion Amex debe contener 10 numeros con opcion de completar con 7 caracteres de texto";
                     *   insert.logws(odt.ArOdt, "ERROR", mensaje);
                     *   return mensaje;
                     * }
                     * if (odt.IdAmex.Length < 8 || odt.IdAmex.Length > 8)
                     * {
                     *   mensaje = "El campo Afiliacion Amex debe contener 10 numeros con opcion de completar con 7 caracteres de texto";
                     *   insert.logws(odt.ArOdt, "ERROR", mensaje);
                     *   return mensaje;
                     * }
                     */
                    //
                    if (odt.Producto == "")
                    {
                        mensaje = "El campo Producto no puede estar vacio";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    if (odt.Proyecto == "")
                    {
                        mensaje = "El campo proyecto no puede estar vacio";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    if (odt.EjecutivoKA == "")
                    {
                        mensaje = "El campo EjecutivoKA no puede estar vacio";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    if (odt.EmailEjecutivoKA == "")
                    {
                        mensaje = "El campo EmailEjecutivoKA no puede estar vacio";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    if (odt.EjecutivoSucursal == "")
                    {
                        mensaje = "El campo EjecutivoSucursal no puede estar vacio";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    if (odt.Sucursal == "")
                    {
                        mensaje = "El campo Sucursal no puede estar vacio";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    if (odt.EmailEjecutivo == "")
                    {
                        mensaje = "El campo EmailEjecutivo no puede estar vacio";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    if (odt.TelEjecutivo == "")
                    {
                        mensaje = "El campo TelEjecutivo no puede estar vacio";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    if (odt.TelSucursal == "")
                    {
                        mensaje = "El campo TelSucursal no puede estar vacio";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    if (odt.ContactoComercio == "")
                    {
                        mensaje = "El campo ContactoComercio no puede estar vacio";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    if (odt.Contacto1 == "")
                    {
                        mensaje = "El campo Contacto1 no puede estar vacio";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    if (odt.Contacto2 == "")
                    {
                        mensaje = "El campo Contacto2 no puede estar vacio";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    /*Se agrega campo 27/02/2020*/
                    if (odt.TipoServicio.Normalize(NormalizationForm.FormD) == "BOARDING DIGITAL" && (odt.SubtipoServicio.Normalize(NormalizationForm.FormD) == "CONTRATO DE RECUPERACION DE FIRMA"))
                    {
                        if (odt.Canal == "")
                        {
                            mensaje = "El campo Canal no puede estar vacio";
                            insert.logws(odt.ArOdt, "ERROR", mensaje);
                            return(mensaje);
                        }
                        //Se agrega nueva validacion 03/03/2020
                        C_CANALES canal = contex_.C_CANALES.Where(x => x.DESC_CANAL == odt.Canal.TrimEnd()).FirstOrDefault();
                        if (canal == null)
                        {
                            mensaje = "El campo Canal no es valido";
                            insert.logws(odt.ArOdt, "ERROR", mensaje);
                            return(mensaje);
                        }
                        //Fin
                    }

                    if (odt.TipoServicio.Normalize(NormalizationForm.FormD) == "INSTALACION DE BOARDING DIGITAL" && (odt.SubtipoServicio.Normalize(NormalizationForm.FormD) == "INSTALACION BD"))
                    {
                        if (odt.Canal == "")
                        {
                            mensaje = "El campo Canal no puede estar vacio";
                            insert.logws(odt.ArOdt, "ERROR", mensaje);
                            return(mensaje);
                        }
                        //Se agrega nueva validacion 03/03/2020
                        C_CANALES canal = contex_.C_CANALES.Where(x => x.DESC_CANAL == odt.Canal.TrimEnd()).FirstOrDefault();
                        if (canal == null)
                        {
                            mensaje = "El campo Canal no es valido";
                            insert.logws(odt.ArOdt, "ERROR", mensaje);
                            return(mensaje);
                        }
                        //Fin
                    }

                    /*Fin*/

                    /*                if (odt.ModeloTPV == "")
                     *              {
                     *                  mensaje = "El campo ModeloTPV no puede estar vacio";
                     *                  insert.logws(odt.ArOdt, "ERROR", mensaje);
                     *                  return mensaje;
                     *              }
                     */
                    if (odt.Carga == "")
                    {
                        mensaje = "El campo Carga no puede estar vacio";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    if (idservicio == 0)
                    {
                        mensaje = "El servicio ingresado no existe";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    if (idfalla == 0)
                    {
                        mensaje = "El subtipo de servicio ingresado no existe";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    if (idproveedor == 0)
                    {
                        mensaje = "El proveedor ingresado no existe";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }
                    if (idproducto == 0)
                    {
                        mensaje = "El producto ingresado no existe";
                        insert.logws(odt.ArOdt, "ERROR", mensaje);
                        return(mensaje);
                    }

                    if (idarunico.isarunico == 1)
                    {
                        var totalar = (from f in contex_.BD_AR where f.NO_AR == odt.ArOdt select f.ID_AR).Count();
                        if (totalar >= 1)
                        {
                            mensaje = "ODT Repetido";
                            insert.logws(odt.ArOdt, "ERROR", mensaje);
                            return(mensaje);
                        }
                        else
                        {
                            Updates    updates    = new Updates();
                            Procedures procedures = new Procedures();


                            var idcarga = insert.carga(odt);
                            int idar    = insert.ar(odt, idcarga, idservicio, idfalla, idproveedor, idsegmento, idproducto);
                            updates.carga(idcarga);
                            procedures.ingresarServicio(idcarga);
                            updates.arStatus(idar, 32);
                            updates.arStatusText(idar, "Interfaz");
                            insert.bitacoraAr(idar, 1, 32, "Solicitud de servicio esperando confirmacion.");

                            mensaje = "PREODT ASIGNADA " + odt.ArOdt;
                            val     = "EXITO";
                        }
                    }
                }
                else
                {
                    mensaje = "El campo FolioTelecarga no puede contener datos.";
                    insert.logws(odt.ArOdt, "ERROR", mensaje);
                    return(mensaje);
                }
            }
            catch (Exception ex)
            {
                mensaje = ex.StackTrace;
                val     = "ERROR";
            }
            Inserts inserts = new Inserts();

            inserts.logws(odt.ArOdt, val, mensaje);
            return(mensaje);
        }
示例#9
0
        //public void LoadFromXml(XmlElement xml)
        //{
        //    Inserts.Clear();
        //    Updates.Clear();
        //    Deletes.Clear();

        //    foreach(XmlElement xitem in xml.SelectNodes("Insert"))
        //    {
        //        var item = new ChangeSetInsertItem();
        //        item.LoadFromXml(xitem);
        //        Inserts.Add(item);
        //    }
        //}
        public bool HasChanges()
        {
            return(Updates.Any() || Inserts.Any() || Deletes.Any());
        }