コード例 #1
0
 internal void SaveNota(Nota objNota)
 {
     using (CalendarClassEntitiesDataContext dc = new CalendarClassEntitiesDataContext(App.conexionString))
     {
         dc.Notas.InsertOnSubmit(objNota);
         dc.SubmitChanges();
     }
 }
コード例 #2
0
        internal void UpdateNota(Nota objNota)
        {
            using (CalendarClassEntitiesDataContext dc = new CalendarClassEntitiesDataContext(App.conexionString))
            {
                Nota _objNota = dc.Notas.Single(p => p.NotaId == objNota.NotaId);

                _objNota.ValorNota = objNota.ValorNota;
                _objNota.Porcentaje = objNota.Porcentaje;

                dc.SubmitChanges();
            }
        }
コード例 #3
0
        private void BtnGuardar_Click(object sender, System.EventArgs e)
        {
            Nota objNota = new Nota();

            objNota.ValorNota = Convert.ToDouble(TxtNota.Text);
            objNota.Porcentaje = Convert.ToDouble(TxtPorcentajeNota.Text);
            objNota.MateriaId = App.Context.MateriaSeleccionada.MateriaId;

            if (esNuevo)
                new NotasDao().SaveNota(objNota);
            else
            {
                objNota.NotaId = App.Context.NotaSeleccionada.NotaId;
                new NotasDao().UpdateNota(objNota);
            }

            NavigationService.GoBack();
        }
		private void detach_Notas(Nota entity)
		{
			this.SendPropertyChanging();
			entity.Actividad = null;
		}
 partial void DeleteNota(Nota instance);
 partial void UpdateNota(Nota instance);
 partial void InsertNota(Nota instance);
		private void detach_Notas(Nota entity)
		{
			this.SendPropertyChanging();
			entity.Materia = null;
		}
		private void attach_Notas(Nota entity)
		{
			this.SendPropertyChanging();
			entity.Materia = this;
		}