public Boolean AnularDB(fa_venta_telefonica_Info Info) { try { EntitiesFacturacion context = new EntitiesFacturacion(); var address = context.fa_venta_telefonica.FirstOrDefault(var => var.IdEmpresa == Info.IdEmpresa && var.IdVenta_tel == Info.IdVenta_tel && var.IdSucursal == Info.IdSucursal); if (address != null) { address.Estado = Info.Estado; address.IdUsuarioUltAnu = Info.IdUsuarioUltAnu; address.Fecha_UltAnu = Info.Fecha_UltAnu; 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); mensaje = ex.ToString(); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); throw new Exception(ex.ToString()); } }
public Boolean GuardarDB(fa_venta_telefonica_Info Info, ref decimal Id) { try { EntitiesFacturacion context = new EntitiesFacturacion(); var address = new fa_venta_telefonica(); address.IdEmpresa = Info.IdEmpresa; address.IdSucursal = Info.IdSucursal; address.IdVenta_tel = Id = GetId(Info.IdEmpresa, Info.IdSucursal); address.IdCliente = Info.IdCliente; address.IdMotivo = Info.IdMotivo; address.Observacion = Info.Observacion; address.Fecha = Info.Fecha; address.Estado = Info.Estado; address.Contactar_futuro = Info.Contactar_futuro; address.IdUsuario = Info.IdUsuario; address.Fecha_Transac = Convert.ToDateTime(Info.Fecha_Transac); address.ip = Info.ip; address.nom_pc = Info.nom_pc; context.fa_venta_telefonica.Add(address); 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); mensaje = ex.ToString(); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); throw new Exception(ex.ToString()); } }
void ucGe_Menu_Mantenimiento_x_usuario_event_btnModificar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { //showFormulario(Cl_Enumeradores.eTipo_action.actualizar); fa_venta_telefonica_Info i = gridViewVentaFono.GetFocusedRow() as fa_venta_telefonica_Info; if (i == null) { MessageBox.Show("Seleccione un registro", "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (i.Estado == "I") { MessageBox.Show("No se pueden modificar registros inactivos", "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { frm1 = new frmFa_Ventas_Telefonicas_Mant(Cl_Enumeradores.eTipo_action.actualizar); frm1.Event_frmFa_Ventas_Telefonicas_Mantenimiento_FormClosing += new frmFa_Ventas_Telefonicas_Mant.delegate_frmFa_Ventas_Telefonicas_Mantenimiento_FormClosing(event_frmFa_Ventas_Telefonicas_Mantenimiento_FormClosing); frm1.Text = frm1.Text + " ***ACTUALIZAR REGISTRO***"; frm1.setInfo(i); frm1.Show(); } } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); } }
public void setInfo(fa_venta_telefonica_Info Info) { try { _Info = Info; } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); } }
public List <fa_venta_telefonica_Info> Get_List_venta_telefonica(int IdEmpresa, int IdSucursal, DateTime fechaInicio, DateTime fechaFin) { try { List <fa_venta_telefonica_Info> lst = new List <fa_venta_telefonica_Info>(); EntitiesFacturacion context = new EntitiesFacturacion(); fa_venta_telefonica_Info Info; var select = from q in context.fa_venta_telefonica where q.IdEmpresa == IdEmpresa && q.IdSucursal == IdSucursal && (q.Fecha >= fechaInicio && q.Fecha <= fechaFin) orderby q.IdVenta_tel descending select q; foreach (var item in select) { Info = new fa_venta_telefonica_Info(); Info.IdEmpresa = item.IdEmpresa; Info.IdVenta_tel = item.IdVenta_tel; Info.IdCliente = item.IdCliente; Info.IdSucursal = item.IdSucursal; Info.IdMotivo = item.IdMotivo; Info.Observacion = item.Observacion; Info.Fecha = item.Fecha; Info.Estado = item.Estado; Info.Contactar_futuro = item.Contactar_futuro; Info.IdUsuario = item.IdUsuario; Info.Fecha_Transac = item.Fecha_Transac; Info.ip = item.ip; Info.nom_pc = item.nom_pc; Info.IdUsuarioUltMod = item.IdUsuarioUltMod; Info.Fecha_UltMod = item.Fecha_UltMod; Info.IdUsuarioUltAnu = item.IdUsuarioUltAnu; Info.Fecha_UltAnu = item.Fecha_UltAnu; lst.Add(Info); } return(lst); } 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); mensaje = ex.ToString(); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); throw new Exception(ex.ToString()); } }
public Boolean ModificarDB(fa_venta_telefonica_Info Info) { try { return(data.ModificarDB(Info)); } 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(fa_venta_telefonica_Bus) }; } }