예제 #1
0
        protected void btnAddDisciplina_Click(object sender, EventArgs e)
        {
            lblErrorDisciplina.Text = string.Empty;

            var fila = String.Empty;
            var list =new List<WebDisciplinas>();
            WebDisciplinas oWebDisciplinas = null;
            try
            {
                foreach (DataRow item in dt.Rows)
                {
                    fila = item[0].ToString();

                    oWebDisciplinas = new WebDisciplinas {Descripcion = item[1].ToString()};

                    list.Add(oWebDisciplinas);
                }

                //grabar.
                new DataAccess.Web().AddDisciplinasList(list);

                ClientScript.RegisterStartupScript(GetType(), "Disciplinas", "alert('El archivo fue importado con éxito.');", true);

                dt = null;
                btnAddDisciplina.Visible = false;
                gvDisciplina.DataSource = dt;
                gvDisciplina.DataBind();
                lblMessageDisciplina.Visible = false;
            }
            catch (Exception ex)
            {
                if (!String.IsNullOrEmpty(fila))
                    lblErrorDisciplina.Text = "Fila: " + fila + ". " + ex.Message;
                else
                    lblErrorDisciplina.Text = ex.Message;

                SaveTechLog(System.Reflection.MethodBase.GetCurrentMethod().Name, LevelError.ERROR, ex, "");
            }
        }
예제 #2
0
파일: WebTorneos.cs 프로젝트: GeraElem/VS
        private void FixupWebDisciplinas(WebDisciplinas previousValue)
        {
            if (previousValue != null && previousValue.WebTorneos.Contains(this))
            {
                previousValue.WebTorneos.Remove(this);
            }

            if (WebDisciplinas != null)
            {
                if (!WebDisciplinas.WebTorneos.Contains(this))
                {
                    WebDisciplinas.WebTorneos.Add(this);
                }
                if (WebDisciplinaId != WebDisciplinas.WebDisciplinaId)
                {
                    WebDisciplinaId = WebDisciplinas.WebDisciplinaId;
                }
            }
        }