public void DA_Registrar_CRONOGRAMA_DETALLE(AP_CronogramaCampDetalle cd)
 {
     try
     {
         using (SqlConnection conexion = new SqlConnection(conexionString))
         {
             SqlCommand cmd = new SqlCommand("GAP_CRONOGRAMA_DETALLE_INSERT", conexion);
             cmd.CommandType = CommandType.StoredProcedure;
             cmd.Parameters.AddWithValue("@Id_Cronograma", cd.Id_Cronograma);
             cmd.Parameters.AddWithValue("@Id_Actividad", cd.Id_Actividad);
             cmd.Parameters.AddWithValue("@Numero", cd.Numero);
             cmd.Parameters.AddWithValue("@Inicio_Planificado", cd.Inicio_Planificado);
             cmd.Parameters.AddWithValue("@Final_Planificado", cd.Final_Planificado);
             cmd.Parameters.AddWithValue("@Inicio_Ejecutado", cd.Inicio_Ejecutado);
             cmd.Parameters.AddWithValue("@Final_Ejecutado", cd.Final_Ejecutado);
             cmd.Parameters.AddWithValue("@Observacion", cd.Observacion);
             conexion.Open();
             cmd.ExecuteNonQuery();
             conexion.Close();
         }
     }
     catch (Exception err)
     {
         throw (new Exception(err.ToString() + "-" + err.Source.ToString() + "-" + err.Message.ToString()));
     }
 }
示例#2
0
        protected void Registrar_CRONOGRAMA()
        {
            AP_CronogramaCamp        c   = new AP_CronogramaCamp();
            AP_CronogramaCampDetalle cd  = new AP_CronogramaCampDetalle();
            DB_AP_CronogramaCamp     reg = new DB_AP_CronogramaCamp();

            c.Id_Campanhia = Convert.ToInt32(LblIdCamp.Text);
            c.Id_Regional  = Convert.ToInt32(LblIdReg.Text);
            c.Programa     = LblPrograma.Text;
            c.Tipo         = "INICIAL";
            c.Fecha        = DateTime.Now;
            c.Estado       = "ENVIADO";
            reg.DB_Registrar_CRONOGRAMA(c);
        }
示例#3
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");
        }
示例#4
0
        public void DB_Registrar_CRONOGRAMA_DETALLE(AP_CronogramaCampDetalle cd)
        {
            DA_AP_CronogramaCamp Ins = new DA_AP_CronogramaCamp();

            Ins.DA_Registrar_CRONOGRAMA_DETALLE(cd);
        }