public bool GuardarDB(fa_liquidacion_gastos_producto_Info Info, ref string mensaje) { try { using (Entity_Facturacion_FJ Context = new Entity_Facturacion_FJ()) { fa_liquidacion_gastos_producto contact = new fa_liquidacion_gastos_producto(); contact.IdEmpresa = Info.IdEmpresa; if (Info.IdProducto_Liqui == 0) { contact.IdProducto_Liqui = getId(Info.IdEmpresa); } else { contact.IdProducto_Liqui = Info.IdProducto_Liqui; } contact.nom_producto_Liqui = Info.nom_producto_Liqui; contact.estado = Info.estado; contact.IdProducto = Info.IdProducto; Context.fa_liquidacion_gastos_producto.Add(contact); 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(); throw new Exception(ex.ToString()); } }
public bool AnularDB(fa_liquidacion_gastos_producto_Info Info, ref string mensaje) { try { using (Entity_Facturacion_FJ Context = new Entity_Facturacion_FJ()) { fa_liquidacion_gastos_producto contact = Context.fa_liquidacion_gastos_producto.FirstOrDefault(v => v.IdEmpresa == Info.IdEmpresa && v.IdProducto_Liqui == Info.IdProducto_Liqui); if (contact != null) { 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(); throw new Exception(ex.ToString()); } }
public bool AnularDB(fa_liquidacion_gastos_producto_Info Info, ref string mensaje) { try { return(oData.AnularDB(Info, ref mensaje)); } 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(fa_liquidacion_gastos_producto_Bus) }; } }
public void SetInfo(fa_liquidacion_gastos_producto_Info _Info) { try { GasProd_Info = _Info; } catch (Exception ex) { string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name; NameMetodo = NameMetodo + " - " + ex.ToString(); MessageBox.Show(NameMetodo + " " + param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) , param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString()); } }
private void cmb_Liquidacion_Producto_EditValueChanging(object sender, DevExpress.XtraEditors.Controls.ChangingEventArgs e) { try { fa_liquidacion_gastos_producto_Info Info_Producto = List_Liqui_Producto.First(v => v.IdProducto_Liqui == Convert.ToInt32(e.NewValue)); gw_Liquidacion_detalle.SetFocusedRowCellValue(col_IdProducto_Liqui, Info_Producto.IdProducto_Liqui); gw_Liquidacion_detalle.SetFocusedRowCellValue(col_cantidad, 0); gw_Liquidacion_detalle.SetFocusedRowCellValue(col_precio, 0); gw_Liquidacion_detalle.SetFocusedRowCellValue(col_aplica_iva, true); gw_Liquidacion_detalle.SetFocusedRowCellValue(col_por_iva, param.iva); } catch (Exception ex) { string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name; NameMetodo = NameMetodo + " - " + ex.ToString(); MessageBox.Show(NameMetodo + " " + param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString()); } }
private void Get() { try { GasProd_Info = new fa_liquidacion_gastos_producto_Info(); GasProd_Info.IdEmpresa = param.IdEmpresa; GasProd_Info.IdProducto_Liqui = Convert.ToInt32((txtId.EditValue == "") ? 0 : txtId.EditValue); GasProd_Info.nom_producto_Liqui = txtDescripcion.Text; GasProd_Info.IdProducto = Convert.ToDecimal((ucIn_ProductoCmb1.get_ProductoInfo() == null) ? 0 : ucIn_ProductoCmb1.get_ProductoInfo().IdProducto); GasProd_Info.estado = (chkActivo.Checked == true) ? "A" : "I"; } catch (Exception ex) { string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name; NameMetodo = NameMetodo + " - " + ex.ToString(); MessageBox.Show(NameMetodo + " " + param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) , param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString()); } }
void ucGe_Menu_Mantenimiento_x_usuario1_event_btnAnular_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { Info_GasPro = (fa_liquidacion_gastos_producto_Info)this.gridViewGasPro.GetFocusedRow(); if (Info_GasPro == null) { MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Por_favor_seleccione_item_a_anular), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { llama_frm(Cl_Enumeradores.eTipo_action.Anular); } } catch (Exception ex) { string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name; NameMetodo = NameMetodo + " - " + ex.ToString(); MessageBox.Show(NameMetodo + " " + param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) , param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString()); } }
public List <fa_liquidacion_gastos_producto_Info> Get_List_Liqui_Gas_Producto(int IdEmpresa, ref string mensaje) { try { List <fa_liquidacion_gastos_producto_Info> Lista_Liquidacion = new List <fa_liquidacion_gastos_producto_Info>(); using (Entity_Facturacion_FJ Context = new Entity_Facturacion_FJ()) { var select = from q in Context.fa_liquidacion_gastos_producto where IdEmpresa == q.IdEmpresa select q; foreach (var item in select) { fa_liquidacion_gastos_producto_Info contact = new fa_liquidacion_gastos_producto_Info(); contact.IdEmpresa = item.IdEmpresa; contact.IdProducto_Liqui = item.IdProducto_Liqui; contact.nom_producto_Liqui = item.nom_producto_Liqui; contact.estado = item.estado; contact.IdProducto = item.IdProducto; Lista_Liquidacion.Add(contact); } } return(Lista_Liquidacion); } 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(); throw new Exception(ex.ToString()); } }