public Boolean ModificarDB(cxc_cobro_x_Anticipo_Info info, ref string mensaje) { try { Boolean res = false; using (EntitiesCuentas_x_Cobrar cxc = new EntitiesCuentas_x_Cobrar()) { cxc_cobro_x_Anticipo mod = cxc.cxc_cobro_x_Anticipo.FirstOrDefault(v => v.IdEmpresa == info.IdEmpresa && v.IdCliente == info.IdCliente && v.IdAnticipo == info.IdAnticipo); if (mod != null) { mod.Observacion = info.Observacion; mod.Fecha = info.Fecha; //mod.IdCbteCble_Caja = info.IdCbteCble_Caja; //mod.IdEmpresa_Caja = info.IdEmpresa_Caja; mod.IdSucursal = info.IdSucursal; mod.Fecha_Transac = info.Fecha_Transac; mod.IdUsuario = info.IdUsuario; mod.IdUsuarioUltMod = info.IdUsuarioUltMod; mod.Fecha_UltMod = info.Fecha_UltMod; mod.IdUsuarioUltAnu = info.IdUsuarioUltAnu; mod.Fecha_UltAnu = info.Fecha_UltAnu; mod.nom_pc = info.nom_pc; mod.ip = info.ip; mod.Estado = info.Estado; mod.IdCaja = info.IdCaja; cxc.SaveChanges(); res = true; } } return(res); } 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 GrabarDB(cxc_cobro_x_Anticipo_Info info, ref string mensaje) { try { using (EntitiesCuentas_x_Cobrar cxc = new EntitiesCuentas_x_Cobrar()) { cxc_cobro_x_Anticipo data = new cxc_cobro_x_Anticipo(); data.IdEmpresa = info.IdEmpresa; data.IdAnticipo = info.IdAnticipo = GetId(ref mensaje); data.IdCliente = Convert.ToDecimal(info.IdCliente); data.Observacion = info.Observacion; data.Fecha = info.Fecha; //data.IdCbteCble_Caja = info.IdCbteCble_Caja; //data.IdEmpresa_Caja = info.IdEmpresa_Caja; data.IdSucursal = info.IdSucursal; data.Fecha_Transac = info.Fecha_Transac; data.IdUsuario = info.IdUsuario; data.IdUsuarioUltMod = info.IdUsuarioUltMod; data.Fecha_UltMod = info.Fecha_UltMod; data.IdUsuarioUltAnu = info.IdUsuarioUltAnu; data.Fecha_UltAnu = info.Fecha_UltAnu; data.nom_pc = info.nom_pc; data.ip = info.ip; data.Estado = info.Estado; data.IdCaja = info.IdCaja; cxc.cxc_cobro_x_Anticipo.Add(data); cxc.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.InnerException + " " + ex.Message; throw new Exception(ex.InnerException.ToString()); } }