public bool GuardarDB(ct_distribucion_gastos_x_periodo_det_ct_punto_cargo_Info info) { try { using (EntitiesContabilidad_FJ Context = new EntitiesContabilidad_FJ()) { ct_distribucion_gastos_x_periodo_det_ct_punto_cargo Entity = new ct_distribucion_gastos_x_periodo_det_ct_punto_cargo(); Entity.IdEmpresa = info.IdEmpresa; Entity.IdDistribucion = info.IdDistribucion; Entity.Secuencia = info.Secuencia; Entity.IdPunto_cargo = info.IdPunto_cargo; Entity.Porcentaje = info.Porcentaje; Entity.Checked = info.Checked; Context.ct_distribucion_gastos_x_periodo_det_ct_punto_cargo.Add(Entity); Context.SaveChanges(); } return(true); } catch (Exception ex) { string mensaje = ""; 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()); } }
private void gridView_punto_cargo_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { try { ct_distribucion_gastos_x_periodo_det_ct_punto_cargo_Info row_pc = new ct_distribucion_gastos_x_periodo_det_ct_punto_cargo_Info(); row_pc = (ct_distribucion_gastos_x_periodo_det_ct_punto_cargo_Info)gridView_punto_cargo.GetRow(e.RowHandle); if (row_pc == null) { return; } if (e.Column == col_check_pc) { calcular_porcentaje(); } } 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 Cargar_combo() { try { ucCon_Periodo1.Cargar_combos(); List <ct_punto_cargo_Info> lst_punto_cargo = new List <ct_punto_cargo_Info>(); lst_punto_cargo = bus_punto_cargo.Get_List_punto_Cargo_con_subcentro(param.IdEmpresa); foreach (var item in lst_punto_cargo) { ct_distribucion_gastos_x_periodo_det_ct_punto_cargo_Info info_pc = new ct_distribucion_gastos_x_periodo_det_ct_punto_cargo_Info(); info_pc.IdEmpresa = item.IdEmpresa; info_pc.IdPunto_cargo = item.IdPunto_cargo; info_pc.nom_punto_cargo = item.nom_punto_cargo; info_pc.Porcentaje = 0; info_pc.Checked = false; blst_punto_cargo.Add(info_pc); } gridControl_punto_cargo.DataSource = blst_punto_cargo; } 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 bool GuardarDB(ct_distribucion_gastos_x_periodo_det_ct_punto_cargo_Info info) { try { return(oData.GuardarDB(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("", "Get_Info_Punto_cargo", ex.Message), ex) { EntityType = typeof(ct_distribucion_gastos_x_periodo_det_ct_punto_cargo_Bus) }; } }
public List <ct_distribucion_gastos_x_periodo_det_ct_punto_cargo_Info> get_list(int IdEmpresa, decimal IdDistribucion) { try { List <ct_distribucion_gastos_x_periodo_det_ct_punto_cargo_Info> Lista = new List <ct_distribucion_gastos_x_periodo_det_ct_punto_cargo_Info>(); using (EntitiesContabilidad_FJ Context = new EntitiesContabilidad_FJ()) { var lst = from q in Context.ct_distribucion_gastos_x_periodo_det_ct_punto_cargo where q.IdEmpresa == IdEmpresa && q.IdDistribucion == IdDistribucion select q; foreach (var item in lst) { ct_distribucion_gastos_x_periodo_det_ct_punto_cargo_Info info = new ct_distribucion_gastos_x_periodo_det_ct_punto_cargo_Info(); info.IdEmpresa = item.IdEmpresa; info.IdDistribucion = item.IdDistribucion; info.Secuencia = item.Secuencia; info.IdPunto_cargo = item.IdPunto_cargo; info.Porcentaje = item.Porcentaje; info.Checked = item.Checked; Lista.Add(info); } } return(Lista); } catch (Exception ex) { string mensaje = ""; 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()); } }