Esempio n. 1
0
        protected void Registrar_CRONOGRAMA_DETALLE()
        {
            DB_AP_Registro_Org       a   = new DB_AP_Registro_Org();
            AP_CronogramaCampDetalle cd  = new AP_CronogramaCampDetalle();
            DB_AP_CronogramaCamp     reg = new DB_AP_CronogramaCamp();
            string aux = "";
            bool   sw  = true;

            //cont = GVActividades.Rows.Count;
            foreach (GridViewRow dgi in GVActividades.Rows)
            {
                TextBox txini1 = (TextBox)dgi.Cells[2].Controls[1];
                TextBox txfin1 = (TextBox)dgi.Cells[3].Controls[1];
                if (txini1.Text == "" || txfin1.Text == "")
                {
                    sw  = false;
                    aux = GVActividades.Rows[dgi.RowIndex].Cells[1].Text;
                    break;
                }
            }
            if (sw == true)
            {
                Registrar_CRONOGRAMA();
                int idCrono = Convert.ToInt32(a.DB_MaxId("AP_CRONOGRAMA_CAMP", "Id_Cronograma"));
                foreach (GridViewRow d in GVActividades.Rows)
                {
                    TextBox txini = (TextBox)d.Cells[2].Controls[1];
                    TextBox txfin = (TextBox)d.Cells[3].Controls[1];
                    cd.Id_Cronograma      = idCrono;
                    cd.Id_Actividad       = Convert.ToInt32(GVActividades.Rows[d.RowIndex].Cells[0].Text);
                    cd.Numero             = d.RowIndex;
                    cd.Inicio_Planificado = Convert.ToDateTime(txini.Text);
                    cd.Final_Planificado  = Convert.ToDateTime(txfin.Text);
                    cd.Inicio_Ejecutado   = Convert.ToDateTime(txini.Text);
                    cd.Final_Ejecutado    = Convert.ToDateTime(txfin.Text);
                    cd.Observacion        = "";
                    reg.DB_Registrar_CRONOGRAMA_DETALLE(cd);
                }
            }
            else
            {
                LblMsj.Text = "No se definio una fecha para:" + " " + aux;
            }
            Response.Redirect("frmListaCronogramas.aspx");
        }