Exemple #1
0
 public void InsertarPiezasRequeme(int iCodPlanta)
 {
     try
     {
         DataTable dt = this.ObtenerPiezasReQuemado(iCodPlanta);
         if (dt != null & dt.Rows.Count > 0)
         {
             c00_CargaDatos cd = new c00_CargaDatos();
             cd.InsertarInformacion(dt, "pieza");
             cd.ActualizarInformacion(dt, "pieza");
         }
     }
     catch (Exception e) { throw new Exception(this.sClassName + ", InsertarPiezasRequeme: " + e.Message); }
 }
Exemple #2
0
        public static void ProbarCargaDatos()
        {
            List <DataSet> lds = new List <DataSet>();
            DataSet        ds  = null;
            DataTable      dt  = null;
            DataRow        dr  = null;

            ds = new DataSet();

            dt = new DataTable("InsTabla01");
            dt.Columns.Add("Columna01", Type.GetType("System.Int32"));
            dt.Columns.Add("Columna02", Type.GetType("System.Int64"));
            dt.Columns.Add("Columna03", Type.GetType("System.Double"));
            dt.Columns.Add("Columna04", Type.GetType("System.String"));
            dt.Columns.Add("Columna05", Type.GetType("System.DateTime"));
            dt.Columns.Add("Columna06", Type.GetType("System.DateTime"));
            for (int i = 0; i < 10; i++)
            {
                dr = dt.NewRow();
                dr["Columna01"] = (int)(1 + i);
                dr["Columna02"] = (long)(100 + i);
                dr["Columna03"] = (double)(1.5 + i);
                dr["Columna04"] = "valor" + (1 + i).ToString();
                dr["Columna05"] = DateTime.Now;
                dr["Columna06"] = DBNull.Value;
                dt.Rows.Add(dr);
            }
            dt.AcceptChanges();
            ds.Tables.Add(dt);
            //
            dt = new DataTable("UpdTabla01");
            dt.Columns.Add("Columna00", Type.GetType("System.Int32"));
            dt.Columns.Add("Columna01", Type.GetType("System.Int32"));
            dt.Columns.Add("Columna02", Type.GetType("System.Int64"));
            dt.Columns.Add("Columna03", Type.GetType("System.Double"));
            dt.Columns.Add("Columna04", Type.GetType("System.String"));
            dt.Columns.Add("Columna05", Type.GetType("System.DateTime"));
            dt.Columns.Add("Columna06", Type.GetType("System.DateTime"));
            for (int i = 0; i < 5; i++)
            {
                dr = dt.NewRow();
                dr["Columna00"] = (int)(1);
                dr["Columna01"] = (int)(1 + i);
                dr["Columna02"] = (long)(200 + i);
                dr["Columna03"] = (double)(3.5 + i);
                dr["Columna04"] = "valor" + (2 + i).ToString();
                dr["Columna05"] = DateTime.Now;
                dr["Columna06"] = DBNull.Value;
                dt.Rows.Add(dr);
            }
            dt.AcceptChanges();
            ds.Tables.Add(dt);
            //
            dt = new DataTable("DelTabla01");
            dt.Columns.Add("Columna01", Type.GetType("System.Int32"));
            for (int i = 5; i < 8; i++)
            {
                dr = dt.NewRow();
                dr["Columna01"] = (int)(1 + i);
                dt.Rows.Add(dr);
            }
            dt.AcceptChanges();
            ds.Tables.Add(dt);

            lds.Add(ds);

            c00_CargaDatos cObj = new c00_CargaDatos();
            //cObj.(lds);
        }