protected void btnGenerarRestrCR_Click(object sender, EventArgs e) { RESTRICCION restriccion = new RESTRICCION(); if (RadioButtonList1.SelectedValue.ToString().Equals("Temporal")) { restriccion.TIPO_PROHIBICION = 1144; } else if (RadioButtonList1.SelectedValue.ToString().Equals("Permanente")) { restriccion.TIPO_PROHIBICION = 1145; } restriccion.TIPO_GRAVISIMA = Convert.ToInt32(txtGravisimaCR.Text); restriccion.TIPO_GRAVE = Convert.ToInt32(txtGraveCR.Text); restriccion.TIPO_LEVE = Convert.ToInt32(txtLeveCR.Text); if (txtDiasTempCR.Text == null || txtDiasTempCR.Text == "") { restriccion.DIAS_PROH = 0; } else { restriccion.DIAS_PROH = Convert.ToInt32(txtDiasTempCR.Text); } int idRestriccion = NegocioRestriccion.Instancia.InsertarRestriccion(restriccion); lblInfoCR.Text = "La restricción ha sido creada satisfactoriamente"; lblInfoCR.ForeColor=System.Drawing.Color.Gray; lblInfoCR.Visible = true; }
public int Crear(RESTRICCION dto) { int idRestriccion = 0; using (SRI con = new SRI()) { dto.ID_RESTRICCION = NuevoID(); con.RESTRICCION.AddObject(dto); con.SaveChanges(); } return idRestriccion; }
public int InsertarRestriccion(RESTRICCION dto) { return RestriccionDao.Instancia.Crear(dto); }
/// <summary> /// Crear un nuevo objeto RESTRICCION. /// </summary> /// <param name="iD_RESTRICCION">Valor inicial de la propiedad ID_RESTRICCION.</param> /// <param name="tIPO_PROHIBICION">Valor inicial de la propiedad TIPO_PROHIBICION.</param> public static RESTRICCION CreateRESTRICCION(global::System.Decimal iD_RESTRICCION, global::System.Decimal tIPO_PROHIBICION) { RESTRICCION rESTRICCION = new RESTRICCION(); rESTRICCION.ID_RESTRICCION = iD_RESTRICCION; rESTRICCION.TIPO_PROHIBICION = tIPO_PROHIBICION; return rESTRICCION; }
/// <summary> /// Método desusado para agregar un nuevo objeto al EntitySet RESTRICCION. Considere la posibilidad de usar el método .Add de la propiedad ObjectSet<T> asociada. /// </summary> public void AddToRESTRICCION(RESTRICCION rESTRICCION) { base.AddObject("RESTRICCION", rESTRICCION); }