public Boolean ModificarDB(imp_Tipo_docu_pago_Info info, ref string msg) { try { using (EntitiesImportacion context = new EntitiesImportacion()) { var addressG = context.imp_Tipo_docu_pago.FirstOrDefault(cot => cot.CodDocu_Pago == info.CodDocu_Pago); if (addressG != null) { addressG.Descripcion = info.Descripcion; addressG.PideBanco = info.PideBanco; addressG.PideProveedor = info.PideProveedor; context.SaveChanges(); } } return(true); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.ToString() + " " + ex.Message; msg = ex.Message; throw new Exception(ex.ToString()); } }
public List <imp_Tipo_docu_pago_Info> Get_List_Tipo_docu_pago() { List <imp_Tipo_docu_pago_Info> lista = new List <imp_Tipo_docu_pago_Info>(); EntitiesImportacion imp = new EntitiesImportacion(); try { var select = from q in imp.imp_Tipo_docu_pago select q; foreach (var item in select) { imp_Tipo_docu_pago_Info info = new imp_Tipo_docu_pago_Info(); info.CodDocu_Pago = item.CodDocu_Pago; info.Descripcion = item.Descripcion; info.PideBanco = item.PideBanco; info.PideProveedor = item.PideProveedor; lista.Add(info); } return(lista); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.ToString() + " " + ex.Message; throw new Exception(ex.ToString()); } }
public Boolean ModificarDB(imp_Tipo_docu_pago_Info info, ref string msg) { try { return(data.ModificarDB(info, ref msg)); } 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("", "Modificar", ex.Message), ex) { EntityType = typeof(imp_Tipo_docu_pago_Bus) }; } }
private void cmbTipoPagos_SelectedIndexChanged(object sender, EventArgs e) { try { imp_Tipo_docu_pago_Info tipo = (imp_Tipo_docu_pago_Info)cmbTipoPagos.SelectedItem; if (tipo.PideBanco == "S") { pnlBanco.Visible = true; } else { pnlBanco.Visible = false; } if (tipo.PideProveedor == "S") { pnlProveedor.Visible = true; } else { pnlProveedor.Visible = false; } var idtipodpago = InfoTipoPagoTipoCb.First(var => var.CodDocu_Pago == tipo.CodDocu_Pago); tipocbte.IdTipoCbte = idtipodpago.IdTipoCbte; tipocbte.IdTipoCbte_Anul = idtipodpago.IdTipoCbte_Anul; tipocbte.CodDocu_Pago = idtipodpago.CodDocu_Pago; if (idtipodpago != null) { if (_Accion == Cl_Enumeradores.eTipo_action.grabar) { BtnGuardarYsalir.Enabled = true; btnOk.Enabled = true; } } GenerarDiario = true; } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); if (_Accion == Cl_Enumeradores.eTipo_action.grabar) { MessageBox.Show("Usted a Seleccionado Facrtura por proveedor este \n diario se genera desde el modulo cuentas por Pagar", "Sistema Erp"); GenerarDiario = false; } } }
public Boolean GuardarDB(imp_Tipo_docu_pago_Info info, ref string msg) { try { using (EntitiesImportacion context = new EntitiesImportacion()) { EntitiesImportacion imp = new EntitiesImportacion(); decimal cont = 0; try { cont = (from C in imp.imp_Tipo_docu_pago where C.CodDocu_Pago == info.CodDocu_Pago select C).Count(); } catch (Exception) { } if (cont > 0) { msg = "Codigo Ya asignado"; return(false); } var addressG = new imp_Tipo_docu_pago(); addressG.CodDocu_Pago = info.CodDocu_Pago; addressG.Descripcion = info.Descripcion; addressG.PideBanco = info.PideBanco; addressG.PideProveedor = info.PideProveedor; context.imp_Tipo_docu_pago.Add(addressG); context.SaveChanges(); } return(true); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.ToString() + " " + ex.Message; msg = ex.Message; throw new Exception(ex.ToString()); } }