Ejemplo n.º 1
0
 public static int Insert(RelacionCamposTablas_BD tablas, int[] m, string[] pk)
 {
     try
     {
         var procedimiento = new DataLayer();
         for (int i = 0; i < m.Length; i++)
         {
             tablas.RelacionID = m[i];
             tablas.CampoTR = pk[i];
             procedimiento.Insert(tablas);
         }
         return 1;
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Ejemplo n.º 2
0
        public static int saveColumns(string idRelacion, string campoPK, string campoFK)
        {
            try
            {
                var json = new JavaScriptSerializer();

                int[] pk= json.Deserialize<int[]>(idRelacion);
                string[] fk = json.Deserialize<string[]>(campoFK);
                RelacionCamposTablas_BD rt = new RelacionCamposTablas_BD();
                rt.CampoTB = campoPK;

                clsTablaCampo.Insert(rt, pk, fk);

                return 1;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }