/// <summary> /// Función para actualizar registros desde la pantalla de consulta /// </summary> public bool ActualizarDB(in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info info) { try { bool res = false; if (Existe_en_base(info)) { res = Odata.ModificarDB(info); } else { res = Odata.GrabarDB(info); } return(res); } 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("", "GuardarAjusteFisico", ex.Message), ex) { EntityType = typeof(in_AjusteFisico_Bus) }; } }
public bool Existe_en_base(in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info info) { try { using (EntitiesInventario Context = new EntitiesInventario()) { var lst = from q in Context.in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble where q.IdEmpresa == info.IdEmpresa && q.IdCategoria == info.IdCategoria && q.IdLinea == info.IdLinea && q.IdGrupo == info.IdGrupo && q.IdCentroCosto == info.IdCentroCosto && q.IdSub_centro_costo == info.IdSub_centro_costo select q; if (lst.Count() == 0) { return(false); } else { 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; throw new Exception(mensaje); } }
private void gridViewParam_Conta_Cate__CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { try { in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info row = new in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info(); row = (in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info)gridViewParam_Conta_Cate_.GetRow(e.RowHandle); if (row == null) { return; } if (e.Column == colIdCtaCble) { if (MessageBox.Show("¿Esta seguro que desea actualizar la cuenta contable?", param.Nombre_sistema, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { Bus_SubG.ActualizarDB(row); } } } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public List <cp_Aprobacion_Ing_Bod_x_OC_det_Info> Get_List_Aprobacion_Ing_Bod_x_OC_det_x_Proveedor(int IdEmpresa, decimal IdProveedor) { try { List <cp_Aprobacion_Ing_Bod_x_OC_det_Info> lista = new List <cp_Aprobacion_Ing_Bod_x_OC_det_Info>(); in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Bus BusSub_x_CC = new in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Bus(); in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info InfoSub_CC = new in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info(); lista = odata.Get_List_Aprobacion_Ing_Bod_x_OC_det_x_Proveedor(IdEmpresa, IdProveedor); /* * foreach (var item in lista) * { * if (item.es_Inven_o_Consumo == ein_Inventario_O_Consumo.TIC_CONSU) * { * InfoSub_CC = BusSub_x_CC.Get_Info_in_subgrupo(IdEmpresa, item.IdCategoria, item.IdLinea, item.IdGrupo, item.IdSubGrupo, item.IdCentro_Costo, item.IdCentroCosto_sub_centro_costo); * item.IdCtaCble_Gasto = InfoSub_CC.IdCtaCble; * item.IdRegistro = item.IdCentro_Costo + '-' + item.IdCentroCosto_sub_centro_costo; * } * * if (item.es_Inven_o_Consumo == ein_Inventario_O_Consumo.TIC_INVEN) * { * if (string.IsNullOrEmpty(item.IdCtaCble_Inven_x_Produc) == false) * { * item.IdCtaCble_Gasto = item.IdCtaCble_Inven_x_Produc; * } * else * { * if (string.IsNullOrEmpty(item.IdCtaCble_Inven_x_Motivo) == false) * { * item.IdCtaCble_Gasto = item.IdCtaCble_Inven_x_Motivo; * } * else * { * if (string.IsNullOrEmpty(item.IdCtaCtble_Inve_x_Bodega) == false) * { * item.IdCtaCble_Gasto = item.IdCtaCtble_Inve_x_Bodega; * } * } * } * } * * * } * */ return(lista); } 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_Aprobacion_Ing_Bod_x_OC", ex.Message), ex) { EntityType = typeof(cp_Aprobacion_Ing_Bod_x_OC_det_Bus) }; } }
public Boolean GrabarDB(in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info info) { try { try { using (EntitiesInventario context = new EntitiesInventario()) { var lst = from q in context.in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble where q.IdEmpresa == info.IdEmpresa && q.IdCategoria == info.IdCategoria && q.IdLinea == info.IdLinea && q.IdGrupo == info.IdGrupo && q.IdSubgrupo == info.IdSubgrupo && q.IdCentroCosto == info.IdCentroCosto && q.IdSub_centro_costo == info.IdSub_centro_costo select q; if (lst.Count() == 0) { in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble objSubGrupo = new in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble(); objSubGrupo.IdEmpresa = info.IdEmpresa; objSubGrupo.IdCategoria = info.IdCategoria; objSubGrupo.IdLinea = Convert.ToInt32(info.IdLinea); objSubGrupo.IdGrupo = Convert.ToInt32(info.IdGrupo); objSubGrupo.IdSubgrupo = Convert.ToInt32(info.IdSubgrupo); objSubGrupo.IdCentroCosto = info.IdCentroCosto; objSubGrupo.IdSub_centro_costo = info.IdSub_centro_costo; objSubGrupo.IdCtaCble = info.IdCtaCble; context.in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble.Add(objSubGrupo); context.SaveChanges(); } } return(true); } catch (DbEntityValidationException 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; mensaje = "Error al Grabar" + ex.Message; throw new Exception(ex.ToString()); } } 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(mensaje); } }
public void Set_info(in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info _Info) { try { InfoContaCC = _Info; } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void Llamar_pantalla_movimientos(in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info info) { try { FrmIn_Parametrizacion_Contable_x_Cate_gr_x_CC_x_SCC_x_detalle_ing_egr frm = new FrmIn_Parametrizacion_Contable_x_Cate_gr_x_CC_x_SCC_x_detalle_ing_egr(); frm.Set_parametros(param.IdEmpresa, info.IdCategoria, Convert.ToInt32(info.IdLinea), Convert.ToInt32(info.IdGrupo), Convert.ToInt32(info.IdSubgrupo), info.IdCentroCosto, info.IdSub_centro_costo); frm.ShowDialog(); } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public Boolean ModificarDB(in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info info) { try { return(Odata.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("", "GuardarAjusteFisico", ex.Message), ex) { EntityType = typeof(in_AjusteFisico_Bus) }; } }
public Boolean ModificarDB(in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info info) { try { try { using (EntitiesInventario context = new EntitiesInventario()) { var contact = context.in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble.FirstOrDefault( var => var.IdEmpresa == info.IdEmpresa && var.IdCategoria == info.IdCategoria && var.IdLinea == info.IdLinea && var.IdGrupo == info.IdGrupo && var.IdSubgrupo == info.IdSubgrupo && var.IdCentroCosto == info.IdCentroCosto && var.IdSub_centro_costo == info.IdSub_centro_costo ); if (contact != null) { contact.IdCtaCble = info.IdCtaCble; context.SaveChanges(); } } return(true); } catch (DbEntityValidationException 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; mensaje = "Error al Grabar" + ex.Message; throw new Exception(ex.ToString()); } } 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(mensaje); } }
private void btnMostrar_movimientos_Click(object sender, EventArgs e) { try { in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info row = new in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info(); row = (in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info)gridViewParam_Conta_Cate_.GetFocusedRow(); if (row != null) { Llamar_pantalla_movimientos(row); } } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void gridViewParam_Conta_Cate__CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { try { in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info row = new in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info(); row = (in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info)gridViewParam_Conta_Cate_.GetRow(e.RowHandle); if (row == null) { return; } if (e.Column == colIdCtaCble) { if (!string.IsNullOrEmpty(row.IdCtaCble)) { var cta = ListInfoPlanCta.Where(q => q.IdCtaCble == row.IdCtaCble).FirstOrDefault(); if (cta != null && cta.pc_EsMovimiento == "N") { MessageBox.Show("La cuenta seleccionada no está parametrizada como cuenta de movimiento, por favor corrija", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (MessageBox.Show("¿Esta seguro que desea actualizar la cuenta contable?", param.Nombre_sistema, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { Bus_SubG.ActualizarDB(row); } } else { if (MessageBox.Show("¿Esta seguro que desea actualizar la cuenta contable?", param.Nombre_sistema, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { Bus_SubG.ActualizarDB(row); } } Buscar(); } } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
void Get_info() { try { InfoContaCC = new in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info(); InfoContaCC.IdEmpresa = param.IdEmpresa; InfoContaCC.IdCategoria = ucin_cat_lin_gr_sgr.Get_info_categoria().IdCategoria; InfoContaCC.IdLinea = ucin_cat_lin_gr_sgr.Get_info_linea().IdLinea; InfoContaCC.IdGrupo = ucin_cat_lin_gr_sgr.Get_info_grupo().IdGrupo; InfoContaCC.IdSubgrupo = ucin_cat_lin_gr_sgr.Get_info_subgrupo().IdSubgrupo; InfoContaCC.IdCtaCble = ucct_plancta.get_CuentaInfo().IdCtaCble == "" ? null : ucct_plancta.get_CuentaInfo().IdCtaCble; InfoContaCC.IdCentroCosto = cmbCentroCosto.EditValue.ToString(); InfoContaCC.IdSub_centro_costo = cmbSubcentroCosto.EditValue.ToString(); } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info Get_Info_in_subgrupo(int IdEmpresa, string IdCategoria, int IdLinea, int IdGrupo, int IdSubGrupo, string IdCentroCosto, string IdSubCentroCosto) { try { try { in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info dat_ = new in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info(); EntitiesInventario OEUser = new EntitiesInventario(); var select_ = from TI in OEUser.vwin_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble where TI.IdEmpresa == IdEmpresa && TI.IdCategoria == IdCategoria && TI.IdLinea == IdLinea && TI.IdGrupo == IdGrupo && TI.IdSubgrupo == IdSubGrupo && TI.IdCentroCosto == IdCentroCosto && TI.IdSub_centro_costo == IdSubCentroCosto select TI; foreach (var item in select_) { dat_.IdEmpresa = item.IdEmpresa; dat_.IdCategoria = item.IdCategoria; dat_.nom_categoria = item.nom_categoria; dat_.IdLinea = item.IdLinea; dat_.nom_linea = item.nom_linea; dat_.IdGrupo = item.IdGrupo; dat_.nom_grupo = item.nom_grupo; dat_.IdSubgrupo = item.IdSubgrupo; dat_.nom_subgrupo = item.nom_subgrupo; dat_.IdCentroCosto = item.IdCentroCosto; dat_.nom_centro_costo = item.nom_centro_costo; dat_.IdSub_centro_costo = item.IdSub_centro_costo; dat_.nom_sub_centro_costo = item.nom_sub_centro_costo; dat_.IdCtaCble = item.IdCtaCble; } return(dat_); } catch (DbEntityValidationException 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; mensaje = "Error al Grabar" + ex.Message; throw new Exception(ex.ToString()); } } 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(mensaje); } }
public List <in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info> Get_List_Info_in_subgrupo_no_parametrizados(int IdEmpresa) { try { try { List <in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info> Listdat_ = new List <in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info>(); EntitiesInventario OEUser = new EntitiesInventario(); var select_ = from TI in OEUser.vwin_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_no_parametrizados where TI.IdEmpresa == IdEmpresa select TI; foreach (var item in select_) { in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info dat_ = new in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info(); dat_.IdEmpresa = item.IdEmpresa; dat_.IdCategoria = item.IdCategoria; dat_.nom_categoria = "[" + item.IdCategoria + "] " + item.ca_Categoria; dat_.IdLinea = item.IdLinea; dat_.nom_linea = "[" + item.IdLinea.ToString() + "] " + item.nom_linea; dat_.IdGrupo = item.IdGrupo; dat_.nom_grupo = "[" + item.IdGrupo.ToString() + "] " + item.nom_grupo; dat_.IdSubgrupo = item.IdSubGrupo; dat_.nom_subgrupo = "[" + item.IdSubGrupo.ToString() + "] " + item.nom_subgrupo; dat_.IdCentroCosto = item.IdCentroCosto; dat_.nom_centro_costo = "[" + item.IdCentroCosto + "] " + item.nom_Centro; dat_.IdSub_centro_costo = item.IdCentroCosto_sub_centro_costo; dat_.nom_sub_centro_costo = "[" + item.IdCentroCosto_sub_centro_costo + "] " + item.nom_Subcentro; dat_.IdCtaCble = null; Listdat_.Add(dat_); } return(Listdat_); } catch (DbEntityValidationException 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; mensaje = "Error al Grabar" + ex.Message; throw new Exception(ex.ToString()); } } 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(mensaje); } }