public Boolean AnularDB(cp_Conciliacion_Ing_Bodega_x_Orden_Giro_Info Info, ref string msjError) { try { using (EntitiesCuentasxPagar Context = new EntitiesCuentasxPagar()) { var contact = Context.cp_Conciliacion_Ing_Bodega_x_Orden_Giro.FirstOrDefault(co => co.IdEmpresa == Info.IdEmpresa && co.IdConciliacion == Info.IdConciliacion); if (contact != null) { contact.MotiAnula = Info.MotiAnula; contact.Fecha_UltAnu = Info.Fecha_UltAnu; contact.IdUsuarioUltAnu = Info.IdUsuarioUltAnu; contact.Estado = "I"; 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; msjError = mensaje; throw new Exception(ex.ToString()); } }
public Boolean GuardarDB(cp_Conciliacion_Ing_Bodega_x_Orden_Giro_Info Info, ref decimal IdConciliacion, ref string msjError) { try { using (EntitiesCuentasxPagar Context = new EntitiesCuentasxPagar()) { var Address = new cp_Conciliacion_Ing_Bodega_x_Orden_Giro(); Address.IdEmpresa = Info.IdEmpresa; Address.IdConciliacion = Info.IdConciliacion = IdConciliacion = GetId(Info.IdEmpresa); Address.Fecha_Conciliacion = Info.Fecha_Conciliacion; Address.IdProveedor = Info.IdProveedor; Address.Observacion = Info.Observacion; Address.IdEmpresa_Apro_Ing = Info.IdEmpresa_Apro_Ing; Address.IdAprobacion_Apro_Ing = Info.IdAprobacion_Apro_Ing; Address.IdUsuario = Info.IdUsuario; Address.nom_pc = Info.nom_pc; Address.ip = Info.ip; Address.Estado = Info.Estado; Context.cp_Conciliacion_Ing_Bodega_x_Orden_Giro.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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.ToString() + " " + ex.Message; msjError = mensaje; throw new Exception(ex.ToString()); } }
public Boolean AnularDB(cp_Conciliacion_Ing_Bodega_x_Orden_Giro_Info Info, ref string msjError) { try { return(dataConci.AnularDB(Info, ref msjError)); } 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("", "AnularDB", ex.Message), ex) { EntityType = typeof(cp_Conciliacion_Ing_Bodega_x_Orden_Giro_Bus) }; } }
public cp_Conciliacion_Ing_Bodega_x_Orden_Giro_Info Get_Info_Conciliacion_Ing(int IdEmpresa, decimal IdConciliacion) { try { cp_Conciliacion_Ing_Bodega_x_Orden_Giro_Info Info = new cp_Conciliacion_Ing_Bodega_x_Orden_Giro_Info(); using (EntitiesCuentasxPagar listado = new EntitiesCuentasxPagar()) { var select = from q in listado.cp_Conciliacion_Ing_Bodega_x_Orden_Giro where q.IdEmpresa == IdEmpresa && q.IdConciliacion == IdConciliacion select q; foreach (var item in select) { Info.IdEmpresa = item.IdEmpresa; Info.IdConciliacion = item.IdConciliacion; Info.Fecha_Conciliacion = item.Fecha_Conciliacion; Info.IdProveedor = item.IdProveedor; Info.Observacion = item.Observacion; Info.IdEmpresa_Apro_Ing = item.IdEmpresa_Apro_Ing; Info.IdAprobacion_Apro_Ing = item.IdAprobacion_Apro_Ing; Info.IdUsuario = item.IdUsuario; Info.nom_pc = item.nom_pc; Info.ip = item.ip; Info.Estado = item.Estado; Info.MotiAnula = item.MotiAnula; Info.IdUsuarioUltAnu = item.IdUsuarioUltAnu; Info.Fecha_UltAnu = Convert.ToDateTime(item.Fecha_UltAnu); } } return(Info); } 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()); } }
void LimpiarDatos() { try { Info_Ing_Bod = new cp_Conciliacion_Ing_Bodega_x_Orden_Giro_Info(); _Accion = Cl_Enumeradores.eTipo_action.grabar; txtIdConciliacion.EditValue = null; cmbProveedor.Inicializar_cmbProveedor(); txtObservacion.EditValue = ""; lstPendiFact = new BindingList <vwcp_Orden_Giro_Pendiente_Conciliar_Info>(); gridFacturaProveedor.DataSource = lstPendiFact; list_Aprob = new BindingList <cp_Aprobacion_Ing_Bod_x_OC_det_Info>(); gridIngresoBodega.DataSource = list_Aprob; } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public Boolean GuardarDB(cp_Conciliacion_Ing_Bodega_x_Orden_Giro_Info Info, ref decimal IdConciliacion, ref decimal IdIdAprobacion, ref string msjError) { try { if (Bus_Aprob.GuardarDB(Info.cp_Aprobacion_Ing_Bod_x_OC, ref IdIdAprobacion, ref msjError)) { Info.IdEmpresa_Apro_Ing = Info.cp_Aprobacion_Ing_Bod_x_OC.IdEmpresa; Info.IdAprobacion_Apro_Ing = IdIdAprobacion; return(dataConci.GuardarDB(Info, ref IdConciliacion, ref msjError)); } else { return(false); } } 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("", "GuardarDB", ex.Message), ex) { EntityType = typeof(cp_Conciliacion_Ing_Bodega_x_Orden_Giro_Bus) }; } }