public int Insertar(EmpleadoDTO entity) { try { return(bEmpleado.Insertar(entity)); } catch (Exception ex) { throw new FaultException <FaultDTO>(new FaultDTO { FaultId = "-99", FaultDescription = ex.Message }, new FaultReason(ex.Message)); } }
protected void BtnGuardar_Click(object sender, EventArgs e) { if (HctblEmpleado.Value.Equals("")) { HctblEmpleado.Value = "1"; } for (int i = 0; i < Convert.ToInt32(HctblEmpleado.Value); ++i) { DataRow dr = dt.NewRow(); dt.Rows.Add(dr); dt.Rows[i][0] = Request["cmbArea" + (i + 1)]; dt.Rows[i][1] = Request["txtDni" + (i + 1)]; dt.Rows[i][2] = Request["txtNombre" + (i + 1)]; dt.Rows[i][3] = Request["txtApePat" + (i + 1)]; dt.Rows[i][4] = Request["txtApeMat" + (i + 1)]; dt.Rows[i][5] = Request["txtTelef" + (i + 1)]; dt.Rows[i][6] = Request["txtDirec" + (i + 1)]; dt.Rows[i][7] = Request["txtFNac" + (i + 1)]; dt.Rows[i][8] = Request["cmbSex" + (i + 1)]; dt.Rows[i][9] = 1; } ds.Tables.Add(dt); obEmpl.Insertar(ds); }