public Boolean GuardarDB(Af_Activo_fijo_x_ct_punto_cargo_Info info) { try { using (EntitiesActivoFijo_FJ Context = new EntitiesActivoFijo_FJ()) { Af_Activo_fijo_x_ct_punto_cargo Entity = new Af_Activo_fijo_x_ct_punto_cargo(); Entity.IdEmpresa_AF = info.IdEmpresa_AF; Entity.IdActivoFijo_AF = info.IdActivoFijo_AF; Entity.IdEmpresa_PC = info.IdEmpresa_PC; Entity.IdPunto_cargo_PC = info.IdPunto_cargo_PC; Entity.observacion = info.observacion; Context.Af_Activo_fijo_x_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.InnerException + " " + ex.Message; throw new Exception(ex.InnerException.ToString()); } }
public Boolean MergeDB(Af_Activo_fijo_x_ct_punto_cargo_Info info) { try { return(oData.MergeDB(info)); } catch (Exception ex) { string mensaje = ""; mensaje = ex.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(), "", mensaje, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); throw new Exception(mensaje); } }
void SetPuntoCargo() { try { txt_IdPunto_cargo.EditValue = _SetInfo.IdPunto_cargo; txt_codPunto_cargo.Text = _SetInfo.codPunto_cargo; txt_nombre.Text = _SetInfo.nom_punto_cargo; if (_SetInfo.Estado.TrimEnd() == "I") { this.ckbActivo.Checked = false; } else { ckbActivo.Checked = true; } info_af_x_ct = bus_af_x_ct.Get_Info_x_Punto_cargo(_SetInfo.IdEmpresa, _SetInfo.IdPunto_cargo); if (info_af_x_ct.IdActivoFijo_AF != 0) { cmb_Activo_fijo.EditValue = info_af_x_ct.IdActivoFijo_AF; } cmb_grupo.EditValue = _SetInfo.IdPunto_cargo_grupo; _SetInfo.info_punto_cargo_Fj = bus_punto_cargo_fj.Get_info_punto_cargo(_SetInfo.IdEmpresa, _SetInfo.IdPunto_cargo); if (_SetInfo.IdEmpresa != 0) { cmb_centro_costo.EditValue = _SetInfo.info_punto_cargo_Fj.IdCentroCosto; cmb_centro_costo_sub_centro_costo.EditValue = _SetInfo.info_punto_cargo_Fj.IdCentroCosto_sub_centro_costo; } } catch (Exception ex) { string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name; MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) + ex.Message + " ", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString()); } }
public Af_Activo_fijo_x_ct_punto_cargo_Info Get_Info_x_Activo_fijo(int idEmpresa, int idActivo_fijo) { try { Af_Activo_fijo_x_ct_punto_cargo_Info info = new Af_Activo_fijo_x_ct_punto_cargo_Info(); using (EntitiesActivoFijo_FJ Context = new EntitiesActivoFijo_FJ()) { var lst = from q in Context.Af_Activo_fijo_x_ct_punto_cargo where idEmpresa == q.IdEmpresa_AF && idActivo_fijo == q.IdActivoFijo_AF select q; foreach (var item in lst) { info.IdEmpresa_AF = item.IdEmpresa_AF; info.IdActivoFijo_AF = item.IdActivoFijo_AF; info.IdEmpresa_PC = item.IdEmpresa_PC; info.IdPunto_cargo_PC = item.IdPunto_cargo_PC; info.observacion = item.observacion; } } return(info); } 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.InnerException + " " + ex.Message; throw new Exception(ex.InnerException.ToString()); } }