public frmCxc_cobros_x_factura() { InitializeComponent(); Log_Error_bus = new tb_sis_Log_Error_Vzen_Bus(); param = cl_parametrosGenerales_Bus.Instance; info_factura = new fa_factura_Info(); bus_banco = new tb_banco_Bus(); lst_banco = new List <tb_banco_Info>(); bus_cobro_tipo = new cxc_cobro_tipo_Bus(); lst_cobro_tipo = new List <cxc_cobro_tipo_Info>(); blst_det = new BindingList <cxc_cobro_Info>(); bus_cobro = new cxc_cobro_Bus(); }
public Boolean GuardarDB(cxc_cobro_x_Anticipo_Info infoAnticipo, ref string mensaje, Boolean Generar_Cobro_x_det, Cl_Enumeradores.PantallaEjecucion Accion) { try { Boolean resGrabar = true; if (validar_objeto(infoAnticipo, ref mensaje)) { cxc_cobro_Bus cobroBus = new cxc_cobro_Bus(); //grabando cabecera de anticipo resGrabar = data.GrabarDB(infoAnticipo, ref mensaje); foreach (var item in infoAnticipo.listDetalle_Anticipo) { item.IdEmpresa = infoAnticipo.IdEmpresa; item.IdAnticipo = infoAnticipo.IdAnticipo; } //grabando detalle de anticipo data_det.GuardarDB(infoAnticipo.listDetalle_Anticipo, ref mensaje); if (Generar_Cobro_x_det) { int contCobro = 1; foreach (var item in infoAnticipo.listCobros) { cxc_cobro_x_Anticipo_det_Info AnticipoDetalle = new cxc_cobro_x_Anticipo_det_Info(); cxc_cobro_Info infoCobro = item; AnticipoDetalle = infoAnticipo.listDetalle_Anticipo.Find(v => v.IdFila == contCobro); infoCobro.Infocxc_cobro_x_Anticipo_det = AnticipoDetalle; decimal IdCobro = 0; if (cobroBus.GuardarDB(Accion, ref infoCobro, ref mensaje) == false) { return(false); } AnticipoDetalle.IdEmpresa_Cobro = infoCobro.IdEmpresa; AnticipoDetalle.IdCobro_cobro = infoCobro.IdCobro; AnticipoDetalle.IdSucursal_cobro = infoCobro.IdSucursal; contCobro++; } } } else { resGrabar = false; } return(resGrabar); } catch (Exception ex) { Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message); throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "Get_List_Cobro_Tipo", ex.Message), ex) { EntityType = typeof(cxc_cobro_x_Anticipo_Bus) }; } }