public static object ContratoDetalleList(int jtStartIndex, int jtPageSize, string jtSorting, String WhereBy) { int total; int indexPage = jtStartIndex != 0 ? jtStartIndex / jtPageSize : jtStartIndex; eContratoDetalleVC o = new eContratoDetalleVC(); o._inicio = indexPage; o._fin = jtPageSize; o._orderby = jtSorting.Substring(1).ToUpper(); o._nro_Contrato = WhereBy.Trim(); var list = new bContratoDetalleVC().GetSelecionarContratoDetalle(o, out total); return(new { Result = "OK", Records = list, TotalRecordCount = total }); }
public void SetEliminarParamentro(String tabla, String indice) { try { if (tabla.Equals("CONTRATO") && indice != "0") { bContratoVC bc = new bContratoVC(); Int32 resp = bc.SetEliminarContrato(Int32.Parse(indice)); if (resp != 0) { MessageBox(resp + "Registro Eliminado Correctamente!"); SetLLenadoContrato(); } else { MessageBox("Ocurrio un Error en el Servidor!"); } } else if (tabla.Equals("CONTRATO_DETALLE") && indice != "0") { bContratoDetalleVC bcd = new bContratoDetalleVC(); Int32 resp = bcd.SetEliminarContratoDetalle(Int32.Parse(indice)); if (resp != 0) { MessageBox(resp + "Registro Eliminado Correctamente!"); } else { MessageBox("Ocurrio un Error en el Servidor!"); } } else if (tabla.Equals("CONTRATO_SYS") && indice != "0") { var resp = new bContratoSys().SetEliminarContratoSys(Int32.Parse(indice)); MessageBox(resp + "Registro Eliminado Correctamente!"); } else if (tabla.Equals("CONTRATO_SIS_DETALLE") && indice != "0") { var resp = new nContratoSisDetalle().setEliminarContratoDetalle(Int32.Parse(indice)); MessageBox(resp + " Registros (s) eliminado (s) correctamente"); } } catch (Exception ex) { MessageBoxcCatch("Ocurrio el siguiente error " + ex.Message.ToString()); } }
//funcion de insertar reaseguradores private void SetInsertarActualizarContratoDetalle() { try { Int32 resp = 0; eContratoDetalleVC d = new eContratoDetalleVC(); d._ide_Contrato_Det = Convert.ToInt32(txt_idContratoDetalle_c.Value); d._id_Empresa = Convert.ToInt32(Session["idempresa"]); d._nro_Contrato = ddl_contrato_r.SelectedItem.Value; d._ide_Reasegurador = ddl_reasegurador_r.SelectedItem.Value; d._cod_Reasegurador = ddl_reasegurador_r.SelectedItem.Value; d._cod_Empresa_Califica = ddl_calificadora_r.SelectedItem.Value; d._cal_Crediticia = ddl_crediticia_r.SelectedItem.Value; d._mod_Contrato = ddl_tipcont_det_r.SelectedItem.Value; d._prc_Retencion = Convert.ToDecimal(txt_retencion_r.Text); d._prc_Cesion = Convert.ToDecimal(txt_cesion_r.Text); d._prc_participacion_rea = Convert.ToDecimal(txt_participacion_cesion.Text); d._nombre_Rea = txt_nombre_rea.Text; d._nro_Registro_Rea = Convert.ToInt32(txt_nro_registro_rea.Text); d._estado = "A"; d._usu_reg = Session["username"].ToString(); d._usu_mod = Session["username"].ToString(); bContratoDetalleVC icd = new bContratoDetalleVC(); if (d._ide_Contrato_Det == 0) { resp = icd.SetInsertarContratoDetalle(d); MessageBox("Registro Grabado Correctamente!"); } else { resp = icd.SetActualizarContratoDetalle(d); MessageBox("Registro Actualizado Correctamente"); } } catch (Exception e) { MessageBoxcCatch("ERROR =>" + e.Message); } }