Exemplo n.º 1
0
        private void btnRender_Click(object sender, EventArgs e)
        {
            //Create a new list of ADXP(Address Parts)
            List<ADXP> adxpList = new List<ADXP>();

            //Populate the adxpList
            if (!String.IsNullOrEmpty(txtBuildingNumber.Text))
                adxpList.Add(new ADXP(txtBuildingNumber.Text, AddressPartType.BuildingNumber));
            if (!String.IsNullOrEmpty(txtStreetNameBase.Text))
                adxpList.Add(new ADXP(txtStreetNameBase.Text, AddressPartType.StreetNameBase));
            if (!String.IsNullOrEmpty(txtStreetType.Text))
                adxpList.Add(new ADXP(txtStreetType.Text, AddressPartType.StreetType));
            if (!String.IsNullOrEmpty(txtDirection.Text))
                adxpList.Add(new ADXP(txtDirection.Text, AddressPartType.Direction));
            if (!String.IsNullOrEmpty(txtCity.Text))
                adxpList.Add(new ADXP(txtCity.Text, AddressPartType.City));
            if (!String.IsNullOrEmpty(txtState.Text))
                adxpList.Add(new ADXP(txtState.Text, AddressPartType.State));
            if (!String.IsNullOrEmpty(txtCountry.Text))
                adxpList.Add(new ADXP(txtCountry.Text, AddressPartType.Country));
            if (!String.IsNullOrEmpty(txtPostalCode.Text))
                adxpList.Add(new ADXP(txtPostalCode.Text, AddressPartType.PostalCode));
            
            //Create a address out of the Address Parts.
            //NOTE: The PostalAddressUse can be changed to format the address in a variety of ways.
            AD ad = new AD(PostalAddressUse.HomeAddress, adxpList);

            // Get the AD in XML format using the FormatterHelper class.
            string adXmlStr = FormatterHelper.FormatDataType(ad, "AD");

            // Display the generated xml.
            txtXml.Text = adXmlStr;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a patient structure
        /// </summary>
        /// <param name="id">The unique identifier</param>
        /// <param name="name">The name of the patient</param>
        /// <param name="addr">The primary address</param>
        /// <param name="telecom">A primary telecom</param>
        /// <returns>A constructed patient structure</returns>
        public static Patient CreatePatient(
                II id,
                EN name,
                AD addr,
                TEL telecom
            )
        {
            // Instantiate the object
            var retVal = new Patient();

            // Populate address
            retVal.Addr = BAG<AD>.CreateBAG(addr);

            // Confidentiality Code
            retVal.ConfidentialityCode = "N";

            // Effective Time of the types
            // High is populated as "Not Applicable"
            retVal.EffectiveTime = new IVL<TS>(
                (TS)DateTime.Now,
                new TS() { NullFlavor = NullFlavor.NotApplicable }
                );

            // Telecom address
            retVal.Telecom = BAG<TEL>.CreateBAG(telecom);

            // Populate the ID
            retVal.Id = SET<II>.CreateSET(id);

            // Status Code
            retVal.StatusCode = RoleStatus.Active;

            // Return result
            return retVal;
        }
Exemplo n.º 3
0
        public void ADToStringCorrectTest()
        {
            AD toStringValid = new AD(
                new ADXP[]
            {
                new ADXP("Hamilton", AddressPartType.City),
                new ADXP("Ontario", AddressPartType.State),
                new ADXP("CA", AddressPartType.Country)
            }
                );

            Assert.AreEqual("Hamilton Ontario CA", toStringValid.ToString("{CTY}{STA}{CNT}"));
        }
Exemplo n.º 4
0
 /// <summary>
 /// 修改产品
 /// </summary>
 /// <param name="p"></param>
 /// <returns></returns>
 public static int modeAd(AD a)
 {
     using (SqlConnection conn = new SqlConnection(Conn.connString))
     {
         conn.Open();
         using (SqlCommand cmd = conn.CreateCommand())
         {
             cmd.CommandText = string.Format(@"update T_AD set TITLE=N'{0}',CONTENT=N'{1}' where ID='{2}' ",
                                             a.title, a.content, a.id);
             return(cmd.ExecuteNonQuery());
         }
     }
 }
Exemplo n.º 5
0
        public void ADContentDifferentEqualityTest()
        {
            AD a = new AD(
                new ADXP[] {
                new ADXP("123 Main Street West Hamilton ON")
            }
                ), b = new AD(new ADXP[] {
                new ADXP("123 Main Street West Hamilton")
            }
                              );

            Assert.IsFalse(a.Equals(b));
        }
Exemplo n.º 6
0
        private static ReportingPeriodWrapper GetRandomReportingPeriodWrapper(
            IReadOnlyCollection <Type> potentialTypes)
        {
            new { potentialTypes }.AsArg().Must().NotBeNullNorEmptyEnumerableNorContainAnyNulls();

            var randomIndex = ThreadSafeRandom.Next(0, potentialTypes.Count);

            var typeToCreate = potentialTypes.ElementAt(randomIndex);

            var result = (ReportingPeriodWrapper)AD.ummy(typeToCreate);

            return(result);
        }
Exemplo n.º 7
0
 /// <summary>
 /// 删除产品
 /// </summary>
 /// <param name="p"></param>
 /// <returns></returns>
 public static int deleteAd(AD a)
 {
     using (SqlConnection conn = new SqlConnection(Conn.connString))
     {
         conn.Open();
         using (SqlCommand cmd = conn.CreateCommand())
         {
             cmd.CommandText = string.Format(@"delete from T_AD where ID='{0}'",
                                             a.id);
             return(cmd.ExecuteNonQuery());
         }
     }
 }
Exemplo n.º 8
0
        public void FormatPatient()
        {
            // Create a formatter with a graph aide
            XmlIts1Formatter fmtr = new XmlIts1Formatter();

            // Gets or sets a list of aide formatters
            // that assist in the formatting of this instance
            fmtr.GraphAides.Add(new DatatypeFormatter());

            // Format to a string
            StringWriter   sw    = new StringWriter();
            XmlStateWriter xmlSw = new XmlStateWriter(
                XmlWriter.Create(sw, new XmlWriterSettings()
            {
                Indent = true
            })
                );

            // Call our method here...
            var patient = Utils.CreatePatient(
                Guid.NewGuid(),
                EN.CreateEN(EntityNameUse.Legal,
                            new ENXP("John", EntityNamePartType.Given),
                            new ENXP("Smith", EntityNamePartType.Family)
                            ),
                AD.CreateAD(PostalAddressUse.HomeAddress,
                            "123 Main Street West",
                            "Hamilton",
                            "Ontario",
                            "Canada"
                            ),
                "*****@*****.**"
                );

            // Format to the formatter.
            // Details results in a result code
            //  that indicates the outcome of the graph.
            var details = fmtr.Graph(xmlSw, patient);

            // Flush and close
            xmlSw.Close();

            // Output to console
            Console.WriteLine("XML: ");
            Console.WriteLine(sw.ToString());
            Console.WriteLine("Validation:");
            foreach (var dtl in details.Details)
            {
                Console.WriteLine("{0} : {1}", dtl.Type, dtl.Message);
            }
        }
Exemplo n.º 9
0
        ///<summary>
        /// Returns a single repetition of Office/Home Address(STF-11).
        /// throws HL7Exception if the repetition number is invalid.
        /// <param name="rep">The repetition number (this is a repeating field)</param>
        ///</summary>
        public AD GetOfficeHomeAddress(int rep)
        {
            AD ret = null;

            try
            {
                IType t = this.GetField(11, rep);
                ret = (AD)t;
            } catch (System.Exception ex) {
                HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected problem obtaining field value.  This is a bug.", ex);
                throw new System.Exception("An unexpected error ocurred", ex);
            }
            return(ret);
        }
Exemplo n.º 10
0
        // GET: ADs/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(RedirectToAction("Index"));
            }
            AD aD = db.ADS.Find(id);

            if (aD == null)
            {
                return(HttpNotFound());
            }
            return(View(aD));
        }
Exemplo n.º 11
0
 public static List <Caso> ConsultaCaso(Caso caso)
 {
     try
     {
         SQLSentencia peticion = new SQLSentencia();
         peticion.Peticion = "PA CONSULTA GRUA";
         AD acceso = new AD();
         return(acceso.consultarCasos(peticion));
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 12
0
 public static bool modificarCaso(Caso caso)
 {
     try
     {
         SQLSentencia peticion = new SQLSentencia();
         peticion.Peticion = "PA MODIFICAR GRUA";
         AD acceso = new AD();
         return(acceso.ejecutarSentecia(peticion));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 13
0
 public static bool modificarPerfil(Perfil p)
 {
     try
     {
         SQLSentencia peticion = new SQLSentencia();
         peticion.Peticion = @"EXEC PA_Perfiles_Modificar '" + p.nombrePerfil + "'";
         AD acceso = new AD();
         return(acceso.ejecutarSentecia(peticion));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 14
0
        public void ADContentSameEqualityTest()
        {
            AD a = new AD(
                new ADXP[] {
                new ADXP("123 Main Street West Hamilton ON")
            }
                ), b = new AD(new ADXP[] {
                new ADXP("123 Main Street West Hamilton ON")
            }
                              );

            Assert.IsTrue(a.Equals(b));
            Assert.IsTrue(a.Equals((object)b));
        }
Exemplo n.º 15
0
 protected void btnUpdateADMember_Click(object sender, EventArgs e)
 {
     if (AD.UpdateADUsers() > 0)
     {
         lblStatus.Visible = true;
         lblStatus.Text    = "Updated A.D. users (" + Application["records"].ToString() + " records) successfully!";
         gvADUsers.DataBind();
         lblDelStatus.Visible = false;
     }
     else
     {
         lblStatus.Text = "Updation of A.D. users failed! Contact Web Administrator.";
     }
 }
Exemplo n.º 16
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="clientes_Padecimientos"></param>
        /// <param name="accion"></param>
        /// <returns></returns>
        public static bool CRUD_CLIENTES_PADECIMIENTOS(Clientes_Padecimientos_TB clientes_Padecimientos, string accion)
        {
            try
            {
                List <SqlCommand> lstSentencias = new List <SqlCommand>();//Lista de sentencias a ejecutar
                AD objAcceso = new AD();

                SQLSentencias sentencia = new SQLSentencias();
                //Se crea la peticion
                sentencia.Peticion = "EXEC CRUD_CLIENTES_PADECIMIENTOS_SP @CP_ID, @CP_Cliente_ID, @CP_Padecimiento_ID, @CP_Comentarios, @Accion";

                //Se agregan los parametros correspondientes
                SqlParameter CP_ID_P = new SqlParameter();
                CP_ID_P.Value         = clientes_Padecimientos.CP_ID;
                CP_ID_P.SqlDbType     = System.Data.SqlDbType.Int;
                CP_ID_P.ParameterName = "@CP_ID";

                SqlParameter CP_Cliente_ID_P = new SqlParameter();
                CP_Cliente_ID_P.Value         = clientes_Padecimientos.CP_Cliente_ID;
                CP_Cliente_ID_P.SqlDbType     = System.Data.SqlDbType.Int;
                CP_Cliente_ID_P.ParameterName = "@CP_Cliente_ID";

                SqlParameter CP_Padecimiento_ID_P = new SqlParameter();
                CP_Padecimiento_ID_P.Value         = clientes_Padecimientos.CP_Padecimiento_ID;
                CP_Padecimiento_ID_P.SqlDbType     = System.Data.SqlDbType.Int;
                CP_Padecimiento_ID_P.ParameterName = "@CP_Padecimiento_ID";

                SqlParameter CP_Comentarios = new SqlParameter();
                CP_Comentarios.Value         = clientes_Padecimientos.CP_Comentarios;
                CP_Comentarios.SqlDbType     = System.Data.SqlDbType.VarChar;
                CP_Comentarios.ParameterName = "@CP_Comentarios";

                SqlParameter Accion_P = new SqlParameter();
                Accion_P.Value         = accion;
                Accion_P.SqlDbType     = System.Data.SqlDbType.Char;
                Accion_P.ParameterName = "@Accion";

                sentencia.lstParametros.Add(CP_ID_P);
                sentencia.lstParametros.Add(CP_Cliente_ID_P);
                sentencia.lstParametros.Add(CP_Padecimiento_ID_P);
                sentencia.lstParametros.Add(CP_Comentarios);
                sentencia.lstParametros.Add(Accion_P);

                return(objAcceso.EjecutarSentencias(sentencia));
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Exemplo n.º 17
0
 public static bool modificarUsuario(Usuario u)
 {
     try
     {
         SQLSentencia peticion = new SQLSentencia();
         peticion.Peticion = @"EXEC PA_Usuarios_Modificar '" + u.nombreUsuario + "','" + u.pass + "','" + u.estadoUsuario + "'";
         AD acceso = new AD();
         return(acceso.ejecutarSentecia(peticion));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 18
0
 public static List <Chofer> ConsultaChoferRelacionados()
 {
     try
     {
         SQLSentencia sentencia = new SQLSentencia();
         sentencia.Peticion = @"EXEC PA_Choferes_Relacionados";
         AD acceso = new AD();
         return(acceso.consultarChoferesNoRelacionados(sentencia));
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 19
0
 public CoveredPartyParticipantParticipantRole()
 {
     this.id   = new LISTImpl <II, Identifier>(typeof(IIImpl));
     this.code = new CEImpl();
     this.addr = new ADImpl();
     this.playingEntityClassCode  = new CSImpl();
     this.playingEntityTypeId     = new IIImpl();
     this.playingEntityTemplateId = new LISTImpl <II, Identifier>(typeof(IIImpl));
     this.playingEntityCode       = new CEImpl();
     this.playingEntityQuantity   = new LISTImpl <PQ, PhysicalQuantity>(typeof(PQImpl));
     this.playingEntityName       = new PNImpl();
     this.playingEntityBirthTime  = new TSCDAR1Impl();
     this.playingEntityDesc       = new EDImpl <EncapsulatedData>();
 }
Exemplo n.º 20
0
        /// <summary>
        /// Example 68
        /// Creates a patient structure
        /// </summary>
        /// <param name="id">The unique identifier</param>
        /// <param name="name">The name of the patient</param>
        /// <param name="addr">The primary address</param>
        /// <param name="telecom">A primary telecom</param>
        /// <returns>A constructed patient structure</returns>
        public Patient CreatePatient(
            II id,
            EN name,
            AD addr,
            TEL telecom
            )
        {
            // Instantiate the object
            var retVal = new Patient();

            // return a value in a unit test
            // will result in Not Runnable
            return(retVal);
        }
Exemplo n.º 21
0
 public CoveredPartyParticipantParticipantRole()
 {
     this.id   = new LISTImpl <II, Identifier>(typeof(IIImpl));
     this.code = new CE_R2Impl <Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Domainvalue.CoverageRoleType>();
     this.addr = new ADImpl();
     this.playingEntityClassCode  = new CS_R2Impl <EntityClassRoot>();
     this.playingEntityTypeId     = new IIImpl();
     this.playingEntityTemplateId = new LISTImpl <II, Identifier>(typeof(IIImpl));
     this.playingEntityCode       = new CE_R2Impl <Code>();
     this.playingEntityQuantity   = new LISTImpl <PQ, PhysicalQuantity>(typeof(PQImpl));
     this.playingEntityName       = new PNImpl();
     this.playingEntityBirthTime  = new TS_R2Impl();
     this.playingEntityDesc       = new EDImpl <EncapsulatedData>();
 }
Exemplo n.º 22
0
        public ActionResult DeleteConfirmed(int id)
        {
            AD aD = db.ADS.Find(id);

            db.ADS.Remove(aD);
            db.SaveChanges();
            FileInfo F = new FileInfo(Server.MapPath("~/Uploads/ADS/" + id + ".jpg"));

            if (F.Exists)
            {
                F.Delete();
            }
            return(RedirectToAction("Index"));
        }
Exemplo n.º 23
0
        private void btnRender_Click(object sender, EventArgs e)
        {
            //Create a new list of ADXP(Address Parts)
            List <ADXP> adxpList = new List <ADXP>();

            //Populate the adxpList
            if (!String.IsNullOrEmpty(txtBuildingNumber.Text))
            {
                adxpList.Add(new ADXP(txtBuildingNumber.Text, AddressPartType.BuildingNumber));
            }
            if (!String.IsNullOrEmpty(txtStreetNameBase.Text))
            {
                adxpList.Add(new ADXP(txtStreetNameBase.Text, AddressPartType.StreetNameBase));
            }
            if (!String.IsNullOrEmpty(txtStreetType.Text))
            {
                adxpList.Add(new ADXP(txtStreetType.Text, AddressPartType.StreetType));
            }
            if (!String.IsNullOrEmpty(txtDirection.Text))
            {
                adxpList.Add(new ADXP(txtDirection.Text, AddressPartType.Direction));
            }
            if (!String.IsNullOrEmpty(txtCity.Text))
            {
                adxpList.Add(new ADXP(txtCity.Text, AddressPartType.City));
            }
            if (!String.IsNullOrEmpty(txtState.Text))
            {
                adxpList.Add(new ADXP(txtState.Text, AddressPartType.State));
            }
            if (!String.IsNullOrEmpty(txtCountry.Text))
            {
                adxpList.Add(new ADXP(txtCountry.Text, AddressPartType.Country));
            }
            if (!String.IsNullOrEmpty(txtPostalCode.Text))
            {
                adxpList.Add(new ADXP(txtPostalCode.Text, AddressPartType.PostalCode));
            }

            //Create a address out of the Address Parts.
            //NOTE: The PostalAddressUse can be changed to format the address in a variety of ways.
            AD ad = new AD(PostalAddressUse.HomeAddress, adxpList);

            // Get the AD in XML format using the FormatterHelper class.
            string adXmlStr = FormatterHelper.FormatDataType(ad, "AD");

            // Display the generated xml.
            txtXml.Text = adXmlStr;
        }
Exemplo n.º 24
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="agenda"></param>
        /// <param name="accion"></param>
        /// <returns></returns>
        public static bool CRUD_AGENDA(Agenda_TB agenda, string accion)
        {
            try
            {
                List <SqlCommand> lstSentencias = new List <SqlCommand>();//Lista de sentencias a ejecutar
                AD objAcceso = new AD();

                SQLSentencias sentencia = new SQLSentencias();
                //Se crea la peticion
                sentencia.Peticion = "EXEC CRUD_AGENDA_SP @Agenda_ID, @Agenda_Cita_ID, @Agenda_Horario_ID, @Comentarios, @Accion";

                //Se agregan los parametros correspondientes
                SqlParameter Agenda_ID_P = new SqlParameter();
                Agenda_ID_P.Value         = agenda.Agenda_ID;
                Agenda_ID_P.SqlDbType     = System.Data.SqlDbType.SmallInt;
                Agenda_ID_P.ParameterName = "@Agenda_ID";

                SqlParameter Agenda_Cita_ID_P = new SqlParameter();
                Agenda_Cita_ID_P.Value         = agenda.Agenda_Cita_ID;
                Agenda_Cita_ID_P.SqlDbType     = System.Data.SqlDbType.Int;
                Agenda_Cita_ID_P.ParameterName = "@Agenda_Cita_ID";

                SqlParameter Agenda_Horario_ID_P = new SqlParameter();
                Agenda_Horario_ID_P.Value         = agenda.Agenda_Horario_ID;
                Agenda_Horario_ID_P.SqlDbType     = System.Data.SqlDbType.SmallInt;
                Agenda_Horario_ID_P.ParameterName = "@Agenda_Horario_ID";

                SqlParameter Comentarios_P = new SqlParameter();
                Comentarios_P.Value         = agenda.Comentarios;
                Comentarios_P.SqlDbType     = System.Data.SqlDbType.VarChar;
                Comentarios_P.ParameterName = "@Comentarios";

                SqlParameter Accion_P = new SqlParameter();
                Accion_P.Value         = accion;
                Accion_P.SqlDbType     = System.Data.SqlDbType.Char;
                Accion_P.ParameterName = "@Accion";

                sentencia.lstParametros.Add(Agenda_ID_P);
                sentencia.lstParametros.Add(Agenda_Cita_ID_P);
                sentencia.lstParametros.Add(Agenda_Horario_ID_P);
                sentencia.lstParametros.Add(Accion_P);

                return(objAcceso.EjecutarSentencias(sentencia));
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Exemplo n.º 25
0
        /// <summary>
        /// Graph the object <paramref name="o"/> to <paramref name="s"/>
        /// </summary>
        public void Graph(System.Xml.XmlWriter s, object o, DatatypeR2FormatterGraphResult result)
        {
            AD instance = o as AD;

            // Base formatting
            ANYFormatter baseFormatter = new ANYFormatter();

            baseFormatter.Graph(s, instance, result);

            // Use
            if (instance.Use != null && !instance.Use.IsNull)
            {
                s.WriteAttributeString("use", Util.ToWireFormat(instance.Use));
            }

            // No need to format
            if (instance.NullFlavor != null)
            {
                return;
            }

            // Is not ordered
            if (instance.IsNotOrdered != null && instance.IsNotOrdered.HasValue)
            {
                s.WriteAttributeString("isNotOrdered", Util.ToWireFormat(instance.IsNotOrdered));
            }

            // Parts
            if (instance.Part != null)
            {
                foreach (var part in instance.Part)
                {
                    s.WriteStartElement("part", "urn:hl7-org:v3");
                    ADXPFormatter adFormatter = new ADXPFormatter();
                    adFormatter.Graph(s, part, result);
                    s.WriteEndElement();
                }
            }

            // Useable period
            if (instance.UseablePeriod != null)
            {
                s.WriteStartElement("useablePeriod", "urn:hl7-org:v3");
                GTSFormatter gtsFormatter = new GTSFormatter();
                gtsFormatter.Host = this.Host;
                gtsFormatter.Graph(s, instance.UseablePeriod, result);
                s.WriteEndElement();
            }
        }
Exemplo n.º 26
0
        /// <summary>
        /// Crea, modifica y elimina cuentas de usuario
        /// </summary>
        /// <param name="cuenta"></param>
        /// <param name="accion"></param>
        /// <returns></returns>
        public static bool CRUD_CUENTAS(CUENTAS_TB cuenta, string accion)
        {
            try
            {
                List <SqlCommand> lstSentencias = new List <SqlCommand>();//Lista de sentencias a ejecutar
                AD objAcceso = new AD();

                SQLSentencias sentencia = new SQLSentencias();
                //Se crea la peticion
                sentencia.Peticion = "EXEC CRUD_CUENTAS_SP @Cuenta_ID, @Cuenta_Usuario_ID, @Tipo_Cuenta, @Numero_Tarjeta, @Accion";
                //Se agregan los parametros correspondientes
                SqlParameter Cuenta_ID_P = new SqlParameter();
                Cuenta_ID_P.Value         = cuenta.Cuenta_ID;
                Cuenta_ID_P.SqlDbType     = System.Data.SqlDbType.Int;
                Cuenta_ID_P.ParameterName = "@Cuenta_ID";

                SqlParameter Cuenta_Usuario_ID_P = new SqlParameter();
                Cuenta_Usuario_ID_P.Value         = cuenta.Cuenta_Usuario_ID;
                Cuenta_Usuario_ID_P.SqlDbType     = System.Data.SqlDbType.Int;
                Cuenta_Usuario_ID_P.ParameterName = "@Cuenta_Usuario_ID";

                SqlParameter Tipo_Cuenta_P = new SqlParameter();
                Tipo_Cuenta_P.Value         = cuenta.Tipo_cuenta;
                Tipo_Cuenta_P.SqlDbType     = System.Data.SqlDbType.Char;
                Tipo_Cuenta_P.ParameterName = "@Tipo_Cuenta";

                SqlParameter Numero_Tarjeta_P = new SqlParameter();
                Numero_Tarjeta_P.Value         = cuenta.Numero_Tarjeta;
                Numero_Tarjeta_P.SqlDbType     = System.Data.SqlDbType.VarChar;
                Numero_Tarjeta_P.ParameterName = "@Numero_Tarjeta";

                SqlParameter Accion_P = new SqlParameter();
                Accion_P.Value         = accion;
                Accion_P.SqlDbType     = System.Data.SqlDbType.Char;
                Accion_P.ParameterName = "@Accion";

                sentencia.lstParametros.Add(Cuenta_ID_P);
                sentencia.lstParametros.Add(Cuenta_Usuario_ID_P);
                sentencia.lstParametros.Add(Tipo_Cuenta_P);
                sentencia.lstParametros.Add(Numero_Tarjeta_P);
                sentencia.lstParametros.Add(Accion_P);

                return(objAcceso.EjecutarSentencias(sentencia));
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Exemplo n.º 27
0
        /// <summary>
        /// Crea, modifica o elimina un usuario
        /// </summary>
        /// <param name="usuario"></param>
        /// <param name="accion"></param>
        /// <returns></returns>
        public static bool CRUD_USUARIOS(USUARIOS_TB usuario, string accion)
        {
            try
            {
                List <SqlCommand> lstSentencias = new List <SqlCommand>();//Lista de sentencias a ejecutar
                AD objAcceso = new AD();

                SQLSentencias sentencia = new SQLSentencias();
                //Se crea la peticion
                sentencia.Peticion = "EXEC CRUD_USUARIOS_SP @Usuario_ID, @Email, @Pass, @Tipo_Usuario, @Accion";
                //Se agregan los parametros correspondientes
                SqlParameter Usuario_ID_P = new SqlParameter();
                Usuario_ID_P.Value         = usuario.Usuario_ID;
                Usuario_ID_P.SqlDbType     = System.Data.SqlDbType.Int;
                Usuario_ID_P.ParameterName = "@Usuario_ID";

                SqlParameter Email_P = new SqlParameter();
                Email_P.Value         = usuario.Email;
                Email_P.SqlDbType     = System.Data.SqlDbType.VarChar;
                Email_P.ParameterName = "@Email";

                SqlParameter Pass_P = new SqlParameter();
                Pass_P.Value         = usuario.Pass;
                Pass_P.SqlDbType     = System.Data.SqlDbType.VarChar;
                Pass_P.ParameterName = "@Pass";

                SqlParameter Tipo_Usuario_P = new SqlParameter();
                Tipo_Usuario_P.Value         = usuario.Tipo_Usuario;
                Tipo_Usuario_P.SqlDbType     = System.Data.SqlDbType.TinyInt;
                Tipo_Usuario_P.ParameterName = "@Tipo_Usuario";

                SqlParameter Accion_P = new SqlParameter();
                Accion_P.Value         = accion;
                Accion_P.SqlDbType     = System.Data.SqlDbType.Char;
                Accion_P.ParameterName = "@Accion";

                sentencia.lstParametros.Add(Usuario_ID_P);
                sentencia.lstParametros.Add(Email_P);
                sentencia.lstParametros.Add(Pass_P);
                sentencia.lstParametros.Add(Tipo_Usuario_P);
                sentencia.lstParametros.Add(Accion_P);

                return(objAcceso.EjecutarSentencias(sentencia));
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Exemplo n.º 28
0
        public static void Main(string[] args)
        {
            DNumber a = new DNumber(1.0f).GetReverse(0);

            DNumber  b     = a * 2;
            DNDArray array = new DNDArray(new Util.NativeDataBuffer <double>(new double[] { 1, 2, 3, 4, 5, 6 }), new long[] { 2, 3 });

            DNumber c = AD.Sum(array * b);

            Float64.DOps.reverseProp(new DNumber(1.0f).asADD, c.asADD);

            Console.WriteLine(b.A.Value);

            Console.ReadKey();
        }
Exemplo n.º 29
0
        /// <summary>
        /// Updates the description of this achievement.
        /// </summary>
        private void UpdateDescription()
        {
            // Determine text from the achievement strings
            var type = AD.GetAchievementData(ID);

            if (type == null)
            {
                description = AchievementStrings.DEFAULT_PROGRESS;
            }
            else
            {
                description = AD.GetStringValue(type, "PROGRESS") ?? AchievementStrings.
                              DEFAULT_PROGRESS.text;
            }
        }
Exemplo n.º 30
0
        public ActionResult ADClick(int?id)
        {
            if (id == null)
            {
                return(RedirectToAction("Home"));
            }
            AD ad = db.ADS.Find(id);

            if (ad == null)
            {
                return(RedirectToAction("Home"));
            }
            db.ADClick(ad.ID);
            return(Redirect(ad.Link));
        }
Exemplo n.º 31
0
        public void Begin()
        {
            oAD       = new AD(0, dsn, intEnvironment);
            oFunction = new Functions(0, dsn, intEnvironment);

            double dblWait = dblSleep * 60.00;  // Minutes to seconds

            dblWait  = dblWait * 1000.00;       // Seconds to milliseconds
            intSleep = Int32.Parse(dblWait.ToString("0"));

            ThreadStart oThreadStart = new ThreadStart(Go);
            Thread      oThread      = new Thread(oThreadStart);

            oThread.Start();
        }
Exemplo n.º 32
0
    void Awake()
    {
        if (instance == null)
        {
            DontDestroyOnLoad(gameObject);

            instance = this;
            ads      = GetComponent <AD>();
        }
        else
        {
            DestroyObject(gameObject);
        }
        highScore = 0;
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     bool validated = false;
     AD ad = new AD("LDAP://utl.co.ug", "utl\\utl030530", "resetpassword");
     Dictionary<string,object> userDetails = ad.getUserDetails(Page.User.Identity.Name.Split(new char[]{'\\'})[1]);
     string[] Dls = (string [])userDetails["dls"];
     List<string> allowedProfiles = new List<string>() { "DL-Callcen-Back office", "DL-CUSTOMER SERVICE ADVISORS", "DL-CallCen Msente", "DL-CallCen The Royals", "DL-IT VAS&TI", "DL-Service Centre Team Leaders" };
     foreach (string dl in Dls)
     {
         if (allowedProfiles.Contains(dl))
         {
             validated = true;
             break;
         }
     }
     if (!validated)
     {
         Response.StatusCode = 403;
         Response.Write("Access Denied");
         Response.End();
     }
 }
Exemplo n.º 34
0
 public void ADContentSameEqualityTest()
 {
     AD a = new AD(
         new ADXP[] { 
             new ADXP("123 Main Street West Hamilton ON")
         }
     ), b = new AD(new ADXP[] { 
             new ADXP("123 Main Street West Hamilton ON")
         }
     );
     Assert.IsTrue(a.Equals(b));
     Assert.IsTrue(a.Equals((object)b));
 }
Exemplo n.º 35
0
 public void ADExampleTest08()
 {
     AD vacationHome = new AD(PostalAddressUse.VacationHome,
         new ADXP[] {
             new ADXP("Canada", AddressPartType.Country)
         }
         );
     vacationHome.NullFlavor = null;
     Console.WriteLine(vacationHome.ToString("{ZIP} - {CTY}, {STA} {CNT}"));
     // output: Canada
     Assert.IsFalse(AD.IsValidBasicFlavor(vacationHome));
 }
Exemplo n.º 36
0
        public void ANYIsNullTest()
        {
            AD isNull = new AD();
            isNull.NullFlavor = NullFlavor.AskedUnknown;

            Assert.AreEqual(true, isNull.IsNull);
        }
Exemplo n.º 37
0
 public void ADExampleTest01()
 {
     AD vacationHome = new AD(PostalAddressUse.VacationHome,
         new ADXP[]{
             new ADXP("321 Cedar Rd. North", AddressPartType.StreetAddressLine),
             new ADXP("Thunder Bay", AddressPartType.City),
             new ADXP("Ontario", AddressPartType.State),
             new ADXP("Canada", AddressPartType.Country),
             new ADXP("N2N2N4", AddressPartType.PostalCode)
         }
         );
     vacationHome.NullFlavor = null;
     Console.WriteLine(vacationHome.ToString("{ZIP} - {CTY}, {STA} {CNT}"));
     // output: N2N2N4 - Thunder Bay, Ontario Canada
     Assert.IsTrue(vacationHome.Validate());
 }
Exemplo n.º 38
0
 public void ADPartNullFlavorValidationTest()
 {
     AD ad = new AD();
     ad.NullFlavor = NullFlavor.Invalid;
     ad.Part.Add(new ADXP("hello"));
     Assert.IsFalse(ad.Validate());
 }
Exemplo n.º 39
0
        /// <summary>
        /// Example 69
        /// Creates a patient structure
        /// </summary>
        /// <param name="id">The unique identifier</param>
        /// <param name="name">The name of the patient</param>
        /// <param name="addr">The primary address</param>
        /// <param name="telecom">A primary telecom</param>
        /// <returns>A constructed patient structure</returns>
        public Patient CreatePatient(
                II id,
                EN name,
                AD addr,
                TEL telecom
            )
        {
            try
            {
                // Instantiate the object
                var retVal = new Patient();

                // Populate address
                retVal.Addr = BAG<AD>.CreateBAG(addr);

                // Confidentiality Code
                retVal.ConfidentialityCode = "N";

                // Effective Time of the types
                // High is populated as "Not Applicable"
                retVal.EffectiveTime = new IVL<TS>(
                    (TS)DateTime.Now,
                    new TS() { NullFlavor = NullFlavor.NotApplicable }
                    );

                // Telecom address
                retVal.Telecom = BAG<TEL>.CreateBAG(telecom);

                // Populate the ID
                retVal.Id = SET<II>.CreateSET(id);

                // Status Code
                retVal.StatusCode = RoleStatus.Active;

                // Set entity choice
                retVal.SetPatientEntityChoiceSubject(
                    new Person()
                    {
                        AdministrativeGenderCode = AdministrativeGender.Male,
                        Name = BAG<EN>.CreateBAG(name),
                        BirthTime = DateTime.Now
                    }
                    );

                // cannot return result for unit test purposes
                return retVal;
            }
            catch
            {
                Console.WriteLine("Unit tests must not return a value, but Patient must be returned..");
                return new Patient();
            }
        }
Exemplo n.º 40
0
 internal void SetStructuredAddress(AD address)
 {
     this.addr = new List<AD>();
     this.addr.Add(address);
 }
Exemplo n.º 41
0
        public ActionResult Login(LoginInfo model)
        {
            //初始化系統參數
            Configer.Init();

            AD AD = new AD();
            VA VA = new VA();
            LoginProcessor LP = new LoginProcessor();
            bool UseCertLogin = false;
            string LDAPName = Configer.LDAPName;
            //string VAVerifyURL = WebConfigurationManager.AppSettings["VAVerifyURL"];
            //string ConnStr = Configer.C_DBConnstring;
            Boolean ContinueLogin = true;

            //Log記錄用
            SYSTEMLOG SL = new SYSTEMLOG();
            SL.UId = model.UserID;
            SL.Controller = "Account";
            SL.Action = "Login";
            SL.StartDateTime = DateTime.Now;
            SL.TotalCount = 1;

            string MailServer = Configer.MailServer;
            int MailServerPort = Configer.MailServerPort;
            string MailSender = Configer.MailSender;
            List<string> MailReceiver = Configer.MailReceiver;
            //string SendResult = string.Empty;

            if (ModelState.IsValid)
            {
                if (LDAPName == "")
                {
                    //缺少系統參數,需記錄錯誤
                    SL.EndDateTime = DateTime.Now;
                    SL.SuccessCount = 0;
                    SL.FailCount = 1;
                    SL.Msg = "登入作業失敗,錯誤訊息:[缺少系統參數LDAPName]";
                    SL.Result = false;
                    SF.log2DB(SL, MailServer, MailServerPort, MailSender, MailReceiver);
                    ContinueLogin = false;
                }
                if (ContinueLogin)
                {
                    AD.UserName = model.UserID;
                    AD.Pwd = model.Pwd;
                    AD.validType = AD.ValidType.Domain;
                    AD.LDAPName = LDAPName;

                    //VA.SignData = model.SignData;
                    //VA.Plaintext = model.Plaintext;
                    //VA.txnCode = "TxnCode";
                    //VA.VAVerifyURL = VAVerifyURL;
                    //VA.Tolerate = 120;

                    DateTime LoginStartTime = DateTime.Now;
                    SF.logandshowInfo("登入開始@" + LoginStartTime.ToString(Configer.SystemDateTimeFormat), log_Info);
                    bool LoginResult = LP.DoLogin(UseCertLogin, AD, VA);
                    DateTime LoginEndTime = DateTime.Now;
                    SF.logandshowInfo("登入結束@" + LoginEndTime.ToString(Configer.SystemDateTimeFormat), log_Info);
                    string LoginSpanTime = OtherProcesser.TimeDiff(LoginStartTime, LoginEndTime, "Milliseconds");
                    SF.logandshowInfo("本次登入共花費@" + LoginSpanTime + "毫秒", log_Info);

                    if (LoginResult == true)
                    {
                        //登入成功,需紀錄
                        SL.EndDateTime = DateTime.Now;
                        SL.SuccessCount = 1;
                        SL.FailCount = 0;
                        SL.Msg = "登入成功";
                        SF.log2DB(SL, MailServer, MailServerPort, MailSender, MailReceiver);
                        Session["UseCertLogin"] = UseCertLogin;
                        //Session["UseCertLogin"] = true;
                        Session["UserID"] = model.UserID;
                        //Session["UserID"] = "TAS191";
                        int UserRole= SF.getUserRole(model.UserID);
                        Session["UserRole"] = UserRole;

                        //主管導向覆核頁面
                        if (UserRole > 3)
                        {
                            return RedirectToAction("Index", "Review");
                        }
                        else
                        {
                            //導向檢查頁面
                            return RedirectToAction("Index", "Process");
                        }
                    }
                    else
                    {
                        //string a=VA.ResultStr;

                        //登入失敗,需記錄錯誤
                        SL.EndDateTime = DateTime.Now;
                        SL.FailCount = 1;
                        if (UseCertLogin)
                        {
                            SL.Msg = "登入失敗,錯誤訊息:[AD或VA驗證失敗]";
                        }
                        else
                        {
                            SL.Msg = "登入失敗,錯誤訊息:[AD驗證失敗]";
                        }
                        SL.Result = false;
                        SF.log2DB(SL, MailServer, MailServerPort, MailSender, MailReceiver);
                        TempData["LoginMsg"] = SL.Msg;

                        return RedirectToAction("Login", "Account");
                    }
                }
                else
                {
                    TempData["LoginMsg"] = "登入失敗,錯誤訊息:[系統登入參數遺失]";
                    return RedirectToAction("Login", "Account");
                }
            }
            else
            {
                return RedirectToAction("Login", "Account");
            }
        }
Exemplo n.º 42
0
        public void ADSETPostalAddressUseIEnumerableADXP_CTORTest()
        {
            AD ctorPostalAddressUseAndADXPArray =
                new AD(
                    new SET<CS<PostalAddressUse>>(
                        new CS<PostalAddressUse>[]
                        {
                            PostalAddressUse.HomeAddress,
                            PostalAddressUse.Direct
                        },CS<PostalAddressUse>.Comparator
                        ),

                    new ADXP[]
                    {
                        new ADXP("Street",AddressPartType.StreetType),
                        new ADXP("Main",AddressPartType.StreetName),
                        new ADXP("122",AddressPartType.BuildingNumber),
                        new ADXP("Hamilton",AddressPartType.City)      
                    }
                );
            Assert.AreEqual(ctorPostalAddressUseAndADXPArray.Part.Count ,4);
            Assert.AreEqual(ctorPostalAddressUseAndADXPArray.Use.Count ,2);
        }
Exemplo n.º 43
0
 internal void SetStructuredAddress(AD address)
 {
     // redefine so as to clear - we only want one address
     this.addr = new List<AD>();
     this.AddStructuredAddress(address);
 }
Exemplo n.º 44
0
 public void ADNullTest()
 {
     AD ad = new AD();
     ad.NullFlavor = null;
     Assert.IsFalse(ad.Validate());
 }
Exemplo n.º 45
0
 public void ADPartNullFlavorTest()
 {
     AD ad = new AD();
     ad.Part.AddRange(GenerateAddress());
     ad.NullFlavor = NullFlavor.NotApplicable;
     Assert.IsFalse(ad.Validate());
 }
Exemplo n.º 46
0
 public void ADNullFlavorValidationTest()
 {
     AD ad = new AD(new ADXP[] {new ADXP("123", AddressPartType.BuildingNumber)});
     ad.NullFlavor = NullFlavor.Invalid;
     Assert.IsFalse(ad.Validate());
 }
Exemplo n.º 47
0
 public void ADExampleTest07()
 {
     AD vacationHome = new AD(PostalAddressUse.VacationHome,
         new ADXP[] {
             new ADXP("Ontario", AddressPartType.State)
         }
         );
     vacationHome.NullFlavor = null;
     Console.WriteLine(vacationHome.ToString("{ZIP} - {CTY}, {STA} {CNT}"));
     // output: Ontario
     Assert.IsTrue(AD.IsValidBasicFlavor(vacationHome));
 }
Exemplo n.º 48
0
 public void R2ADUnknownAddressSerializationTest()
 {
     String expectedXml = @"<test xmlns=""urn:hl7-org:v3"" use=""WP"" nullFlavor=""UNK""/>";
     var adi = new AD(PostalAddressUse.WorkPlace) { NullFlavor = NullFlavor.Unknown };
     String actualXml = R2SerializationHelper.SerializeAsString(adi);
     R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
 }
Exemplo n.º 49
0
        public void ADValidADBasicFlavorTest()
        {
            AD invalidBasicFlavorTest = new AD();

            invalidBasicFlavorTest.Part.Add(new ADXP("Hamilton", AddressPartType.City));
            invalidBasicFlavorTest.Part.Add(new ADXP("Ontario", AddressPartType.State));

            Assert.IsTrue(AD.IsValidBasicFlavor(invalidBasicFlavorTest));
        }
Exemplo n.º 50
0
 public void ADExampleTest04()
 {
     AD vacationHome = new AD(PostalAddressUse.VacationHome,
         new ADXP[] {}
         );
     vacationHome.NullFlavor = NullFlavor.Other;
     Console.WriteLine(vacationHome.ToString("{ZIP} - {CTY}, {STA} {CNT}"));
     // output: N2N2N4 - Thunder Bay, Ontario Canada
     Assert.IsTrue(vacationHome.Validate());
 }
Exemplo n.º 51
0
 internal void AddStructuredAddress(AD address)
 {
     if (this.addr == null)
     {
         this.addr = new List<AD>();
     }
     this.addr.Add(address);
 }
Exemplo n.º 52
0
 public void ADPostalAddressUseIEnumerableADXP_CTORTest()
 {
     AD ctorPostalAddressUseAndADXPArray =
       new AD(
         PostalAddressUse.Direct,
       new ADXP[]
       {
             new ADXP("Street",AddressPartType.StreetType),
             new ADXP("Main",AddressPartType.StreetName),
             new ADXP("122",AddressPartType.BuildingNumber),
             new ADXP("Hamilton",AddressPartType.City)      
       }
    );
     // True if the the AD object has 4 address parts and 1 postal address use.
     Assert.IsTrue(ctorPostalAddressUseAndADXPArray.Part.Count == 4 && ctorPostalAddressUseAndADXPArray.Use.Count == 1);
 }
Exemplo n.º 53
0
 public void ADPartTest()
 {
     AD ad = new AD();
     ad.Part.AddRange(GenerateAddress());
     ad.NullFlavor = null;
     Assert.IsTrue(ad.Validate());
 }
Exemplo n.º 54
0
        public void ADNullFlavorTest()
        {
            AD ad = new AD();
            ad.NullFlavor = NullFlavor.NotAsked;
            Assert.IsTrue(ad.Validate());

        }
Exemplo n.º 55
0
 public void R2ADUnknownAddressParseTest()
 {
     var adi = new AD(PostalAddressUse.WorkPlace) { NullFlavor = NullFlavor.NoInformation };
     String actualXml = R2SerializationHelper.SerializeAsString(adi);
     var ad2 = R2SerializationHelper.ParseString<AD>(actualXml);
     Assert.AreEqual(adi, ad2);
 }
Exemplo n.º 56
0
 public void ADToStringTest()
 {
     AD a = new AD(
         new ADXP[] { 
             new ADXP("123", AddressPartType.BuildingNumber),
             new ADXP("Main", AddressPartType.StreetName),
             new ADXP("Street", AddressPartType.StreetType),
             new ADXP("West", AddressPartType.Direction)
         });
     Assert.AreEqual(a.ToString(), "123MainStreetWest");
 }
Exemplo n.º 57
0
        public void ADUPTest01()
        {
            AD vacationHome = new AD(PostalAddressUse.VacationHome,
                new ADXP[]{
                    new ADXP("321 Cedar Rd. North", AddressPartType.StreetAddressLine),
                    new ADXP("Thunder Bay", AddressPartType.City),
                    new ADXP("Ontario", AddressPartType.State),
                    new ADXP("Canada", AddressPartType.Country),
                    new ADXP("N2N2N4", AddressPartType.PostalCode)
                }
                );

            // Assign a usable period interval to the address
            vacationHome.UseablePeriod = new GTS(
                new PIVL<TS>(
                    new TS(DateTime.Parse("01-May-2011"),
                        DatePrecision.Month).ToIVL(),
                        new PQ (1, "a")
                    )
                );

            vacationHome.NullFlavor = null;
            Assert.IsTrue(vacationHome.Validate());
        }
Exemplo n.º 58
0
 public void ADContentDifferentEqualityTest()
 {
     AD a = new AD(
         new ADXP[] { 
             new ADXP("123 Main Street West Hamilton ON")
         }
     ), b = new AD(new ADXP[] { 
             new ADXP("123 Main Street West Hamilton")
         }
     );
     Assert.IsFalse(a.Equals(b));
 }
Exemplo n.º 59
0
 public void ADTypeMismatchEqualityTest()
 {
     AD a = new AD(
         new ADXP[] { 
             new ADXP("123 Main Street West Hamilton ON")
         }
     );
     Assert.IsFalse(a.Equals("123 Main Street West Hamilton ON"));
 }
Exemplo n.º 60
0
        public void ADToStringCorrectTest()
        {
            AD toStringValid = new AD(
                new ADXP[]
                {
                    new ADXP("Hamilton",AddressPartType.City),
                    new ADXP("Ontario", AddressPartType.State),
                    new ADXP("CA",AddressPartType.Country)
                }
            );

            Assert.AreEqual("Hamilton Ontario CA", toStringValid.ToString("{CTY}{STA}{CNT}"));
        }