Exemple #1
0
        public static List <TDI_DispoApVersion> VerificaDispoIntoVersion(string numTelefono)
        {
            #region Query Armado
            List <TDI_DispoApVersion> lstDispoDisponibles = new List <TDI_DispoApVersion>();
            string strSQL = string.Empty;
            Azteca.Utility.Security.Rijndael _ChyperRijndael = new Azteca.Utility.Security.Rijndael();
            ISession session = NHibernateHelperORACLE.GetSession();

            strSQL += " select ver.ID_DISAPVER id, ver.NUM_TEL numtel, ver.VER_CODE vercode, ver.VER_NAME vername , ver.VER_DATE verdate ";
            strSQL += " from seml_TDI_DispoApVersion ver ";
            strSQL += " where VER.NUM_TEL=" + numTelefono;


            try
            {
                ISQLQuery consultaIQRY = session.CreateSQLQuery(strSQL);

                consultaIQRY.AddScalar("id", NHibernateUtil.Int32);         //0
                consultaIQRY.AddScalar("numtel", NHibernateUtil.String);    //1
                consultaIQRY.AddScalar("vercode", NHibernateUtil.Int32);    //2
                consultaIQRY.AddScalar("vername", NHibernateUtil.String);   //3
                consultaIQRY.AddScalar("verdate", NHibernateUtil.DateTime); //4


                IList lista = consultaIQRY.List();
                foreach (Object[] obj in lista)
                {
                    TDI_DispoApVersion oDispo = new TDI_DispoApVersion();
                    oDispo.ID_DISAPVER = System.Convert.ToInt32(obj[0]);
                    oDispo.NUM_TEL     = System.Convert.ToString(obj[1]);
                    oDispo.NUMBER      = System.Convert.ToInt32(obj[2]);
                    oDispo.VER_NAME    = System.Convert.ToString(obj[3]);
                    oDispo.VER_DATE    = System.Convert.ToDateTime(obj[4]);

                    lstDispoDisponibles.Add(oDispo);
                }
            }
            catch (Exception ex)
            {
                lstDispoDisponibles = null;
                return(lstDispoDisponibles);
            }
            finally
            {
                session.Close();
                session.Dispose();
                session = null;
            }

            return(lstDispoDisponibles);

            #endregion
        }
Exemple #2
0
        public bool ActualizaVersionDispo(string NUM_TEL, int VERSION_CODE, string VER_NAME, string VER_DATE)
        {
            bool   exito            = false;
            string CredentialAccess = _ChyperRijndael.Transmute(ConfigurationManager.AppSettings["LlaveAccesoHTTPS"].ToString(), Azteca.Utility.Security.enmTransformType.intDecrypt);

            if (Credentials.UserName != CredentialAccess && Credentials.Password != CredentialAccess)
            {
                throw new SoapException("Unauthorized", SoapException.ClientFaultCode);
            }
            else
            {
                try
                {
                    List <TDI_DispoApVersion> ExisteDispo = MngNegocioDispositivo.VerificaDispoIntoVersion(NUM_TEL);

                    if (ExisteDispo.Count > 0)
                    {
                        ExisteDispo[0].NUM_TEL  = NUM_TEL;
                        ExisteDispo[0].NUMBER   = VERSION_CODE;
                        ExisteDispo[0].VER_NAME = VER_NAME;
                        ExisteDispo[0].VER_DATE = DateTime.Now;
                        exito = MngNegocioDispositivo.ActualizaVersionDispo(ExisteDispo[0]);
                    }
                    else
                    {
                        TDI_DispoApVersion ObjVersion = new TDI_DispoApVersion();
                        ObjVersion.NUM_TEL  = NUM_TEL;
                        ObjVersion.NUMBER   = VERSION_CODE;
                        ObjVersion.VER_NAME = VER_NAME;
                        ObjVersion.VER_DATE = DateTime.Now;
                        exito = MngNegocioDispositivo.GuardaVersionDispo(ObjVersion);
                    }
                }
                catch (Exception ms)
                {
                }
                return(exito);
            }
        }
Exemple #3
0
 public static Boolean ActualizaVersionDispo(TDI_DispoApVersion dispoVersion)
 {
     return(NHibernateHelperORACLE.SingleSessionUpdate <TDI_DispoApVersion>(dispoVersion));
 }
Exemple #4
0
 public static Boolean GuardaVersionDispo(TDI_DispoApVersion dispoVersion)
 {
     return(NHibernateHelperORACLE.SingleSessionSaveOrUpdate <TDI_DispoApVersion>(dispoVersion));
 }
Exemple #5
0
 public static Boolean ActualizaVersionDispo(TDI_DispoApVersion dispoVersion)
 {
     return(MngDatosDispositivo.ActualizaVersionDispo(dispoVersion));
 }
Exemple #6
0
 public static Boolean GuardaVersionDispo(TDI_DispoApVersion dispoVersion)
 {
     return(MngDatosDispositivo.GuardaVersionDispo(dispoVersion));
 }