コード例 #1
0
 protected void btnIlmoittaudu_Click(object sender, EventArgs e)
 {
     //luodaan kontekstiin uusi entiteetti ja päivitetään muutos kantaan
     if (txtAsioid.Text.Length * txtEtunimi.Text.Length *
         txtSukunimi.Text.Length > 0)
     {
         try
         {
             //luodaan uusi entiteetti
             DemoxOyEntities ctx      = new DemoxOyEntities();
             lasnaolot       lasnaolo = new lasnaolot();
             lasnaolo.asioid    = txtAsioid.Text;
             lasnaolo.course    = "IIO13200";
             lasnaolo.firstname = txtEtunimi.Text;
             lasnaolo.lastname  = txtSukunimi.Text;
             lasnaolo.date      = DateTime.Now;
             //lisätään se kontekstiin
             ctx.lasnaolots.Add(lasnaolo);
             //tallennus kantaan
             ctx.SaveChanges();
             lbMessages.Text = "Ilmoittautuminen tehty.";
         }
         catch (Exception ex)
         {
             lbMessages.Text = ex.Message;
         }
     }
 }
コード例 #2
0
 protected void btnIlmoittaudu_Click(object sender, EventArgs e)
 {
     //luodaan kontekstiin uusi entiteetti ja päivitetään muutos kantaan
     if (txtAsioid.Text.Length * txtEtunimi.Text.Length *
         txtSukunimi.Text.Length > 0)
     {
         try
         {
             //luodaan uusi entiteetti
             DemoxOyEntities ctx = new DemoxOyEntities();
             lasnaolot lasnaolo = new lasnaolot();
             lasnaolo.asioid = txtAsioid.Text;
             lasnaolo.course = "IIO13200";
             lasnaolo.firstname = txtEtunimi.Text;
             lasnaolo.lastname = txtSukunimi.Text;
             lasnaolo.date = DateTime.Now;
             //lisätään se kontekstiin
             ctx.lasnaolots.Add(lasnaolo);
             //tallennus kantaan
             ctx.SaveChanges();
             lbMessages.Text = "Ilmoittautuminen tehty.";
         }
         catch (Exception ex)
         {
             lbMessages.Text = ex.Message;
         }
     }
 }
コード例 #3
0
    protected void btnIlmottaudu_Click(object sender, EventArgs e)
    {
        if (txtboxMyAsioid.Text.Length * txtboxEtunimi.Text.Length * txtboxSukunimi.Text.Length > 0)
        {
            DemoxOyEntities ctx      = new DemoxOyEntities();
            lasnaolot       lasnaolo = new lasnaolot();
            lasnaolo.asioid    = txtboxMyAsioid.Text;
            lasnaolo.course    = "IIO13200";
            lasnaolo.firstname = txtboxEtunimi.Text;
            lasnaolo.lastname  = txtboxSukunimi.Text;
            lasnaolo.date      = DateTime.Now;

            //lisätään se kontekstiin
            ctx.lasnaolots.Add(lasnaolo);
            //tallennus kantaan
            ctx.SaveChanges();
        }
    }
コード例 #4
0
 protected void btnIlmoittaudu_Click(object sender, EventArgs e)
 {
     //Luodaan kontekstiin uusi entiteetti ja päivitetään muutos kantaan
     if (txtAsioid.Text.Length * txtEtunimi.Text.Length * txtSukunimi.Text.Length > 0)
     {
         //Luodaan uusi entiteetti
         DemoxOyEntities ctx      = new DemoxOyEntities();
         lasnaolot       lasnaolo = new lasnaolot();
         lasnaolo.asioid    = txtAsioid.Text;
         lasnaolo.course    = "IIO13200";
         lasnaolo.firstname = txtEtunimi.Text;
         lasnaolo.lastname  = txtSukunimi.Text;
         lasnaolo.date      = DateTime.Now; //new DateTime(2013, 10, 10);
         //Lisätään se kontekstiin
         ctx.lasnaolots.Add(lasnaolo);
         //tallennus kantaan
         ctx.SaveChanges();
     }
 }
コード例 #5
0
 protected void btnIlmoittaudu_Click(object sender, EventArgs e)
 {
     //Luodaan kontekstiin uusi entiteetti ja päivitetään muutos kantaan
     if (txtAsioid.Text.Length * txtEtunimi.Text.Length * txtSukunimi.Text.Length > 0)
     {
         //Luodaan uusi entiteetti
         DemoxOyEntities ctx = new DemoxOyEntities();
         lasnaolot lasnaolo = new lasnaolot();
         lasnaolo.asioid = txtAsioid.Text;
         lasnaolo.course = "IIO13200";
         lasnaolo.firstname = txtEtunimi.Text;
         lasnaolo.lastname = txtSukunimi.Text;
         lasnaolo.date = DateTime.Now;    //new DateTime(2013, 10, 10);
         //Lisätään se kontekstiin
         ctx.lasnaolots.Add(lasnaolo);
         //tallennus kantaan
         ctx.SaveChanges();
     }
 }
コード例 #6
0
 public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
     lasnaolot ds = new lasnaolot();
     global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
     global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
     global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny();
     any.Namespace = ds.Namespace;
     sequence.Items.Add(any);
     type.Particle = sequence;
     global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
     if (xs.Contains(dsSchema.TargetNamespace)) {
         global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
         global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
         try {
             global::System.Xml.Schema.XmlSchema schema = null;
             dsSchema.Write(s1);
             for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
                 schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                 s2.SetLength(0);
                 schema.Write(s2);
                 if ((s1.Length == s2.Length)) {
                     s1.Position = 0;
                     s2.Position = 0;
                     for (; ((s1.Position != s1.Length) 
                                 && (s1.ReadByte() == s2.ReadByte())); ) {
                         ;
                     }
                     if ((s1.Position == s1.Length)) {
                         return type;
                     }
                 }
             }
         }
         finally {
             if ((s1 != null)) {
                 s1.Close();
             }
             if ((s2 != null)) {
                 s2.Close();
             }
         }
     }
     xs.Add(dsSchema);
     return type;
 }