public AgregarTratamiento() { this._presentador = new PresentadorAgregarTratamiento(this); //this.Cont1.Text="Primera"; }
protected void Page_Load(object sender, EventArgs e) { try { MostrarDiv(); conta = 1; if (this.Cont1.Text.Equals("Primera")) { this._presentador.GetDataProducto(); this._presentador.GetDataTratamiento(); this.Cont1.Text = "+Segunda"; Session["Presentador"] = this._presentador; this._presentador.CargarListaProductoSAsociar(this._presentador.ProductoSinAsociar); this._presentador.CargarListaTratamientoSAsociar(this._presentador.TratamientoSinAsociar); // this.SetLabelFalla(this._presentador.ProductoSinAsociar.Count.ToString()); } else { //this.ProductosSinAsociar.Items.Clear(); this._presentador = (PresentadorAgregarTratamiento)Session["Presentador"]; this._presentador.CargarListaProductoSAsociar(this._presentador.ProductoSinAsociar); this._presentador.CargarListaProductoAsociados(this._presentador.ProductosAsociados); this._presentador.CargarListaTratamientoSAsociar(this._presentador.TratamientoSinAsociar); } /* if ((this._presentador.Contador > 0)) { //this.ProductosSinAsociar = new ListBox(); //this.TratamientosSinAsociar = new ListBox(); this._presentador = (PresentadorAgregarTratamiento) Session["Presentador"] ; for (int i = 0; i <= this.ProductosSinAsociar.Rows; i++) this._presentador.ProductoSinAsociar.RemoveAt(i); this._presentador.CargarListaProductoSAsociar(this._presentador.ProductoSinAsociar); } else { this._presentador.Contador = this._presentador.Contador +1; Session["Presentador"] = this._presentador; this._presentador.CargarListaProductoSAsociar(this._presentador.GetDataProducto()); this._presentador.CargarListaTratamientoSAsociar(this._presentador.GetDataTratamiento()); } error.Text = (this._presentador.Contador ).ToString();*/ } catch (ExcepcionTratamiento ex) { error.Text = ex.Message; } catch (NullReferenceException ex) { error.Text = ex.Message; } catch (Exception ex) { error.Text = ex.Message; } }