Ejemplo n.º 1
0
 void ucGe_Menu_Mantenimiento_x_usuario1_event_btnModificar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         Info_GrupCbl = (ct_Grupocble_Info)this.gv_Grup_CtaCble.GetFocusedRow();
         if (Info_GrupCbl != null)
         {
             if (Info_GrupCbl.Estado == "A")
             {
                 llama_frm(Cl_Enumeradores.eTipo_action.actualizar);
             }
             else
             {
                 MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.No_se_puede_modif_regis_Inac), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
         else
         {
             MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Por_favor_seleccione_item_a_modi), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     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());
     }
 }
Ejemplo n.º 2
0
 private void Get()
 {
     try
     {
         Info_Grup_CtaCble                      = new ct_Grupocble_Info();
         Info_Grup_CtaCble.IdGrupoCble          = txtIdGrupCtaCble.Text;
         Info_Grup_CtaCble.gc_GrupoCble         = txtDescripcion.Text;
         Info_Grup_CtaCble.gc_estado_financiero = comboBoxEstadoFinanciero.Text;
         Info_Grup_CtaCble.gc_signo_operacion   = Convert.ToInt32(comboBoxSumaRestaER.EditValue);
         Info_Grup_CtaCble.gc_Orden             = Convert.ToInt32(spinNumeric.Value);
         if (chkActivo.Checked == true)
         {
             Info_Grup_CtaCble.Estado = "A";
         }
         else
         {
             Info_Grup_CtaCble.Estado = "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());
     }
 }
Ejemplo n.º 3
0
 private void bei_GrupoCble_EditValueChanged(object sender, EventArgs e)
 {
     try
     {
         if (bei_GrupoCble.EditValue != null)
         {
             info_GrupoCble = lst_GrupoCble.FirstOrDefault(q => q.IdGrupoCble == bei_GrupoCble.EditValue.ToString());
             if (info_GrupoCble != null)
             {
                 lst_Plancta = bus_Plancta.Get_Plancta_x_Grupo(param.IdEmpresa, info_GrupoCble.IdGrupoCble);
             }
             else
             {
                 lst_Plancta = bus_Plancta.Get_Plancta_x_Grupo(param.IdEmpresa, "");
             }
         }
         else
         {
             lst_Plancta = bus_Plancta.Get_Plancta_x_Grupo(param.IdEmpresa, "");
         }
         cmb_CtaCble.DataSource = lst_Plancta;
     }
     catch (Exception ex)
     {
         string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
         MessageBox.Show(NameMetodo + " - " + ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
     }
 }
Ejemplo n.º 4
0
 public Boolean EliminarDB(ct_Grupocble_Info info, ref string mensaje)
 {
     try
     {
         Boolean res = false;
         using (EntitiesDBConta context = new EntitiesDBConta())
         {
             var contact = context.ct_grupocble.FirstOrDefault(dato => dato.IdGrupoCble == info.IdGrupoCble);
             if (contact != null)
             {
                 contact.Estado = "I";
                 context.SaveChanges();
                 res = true;
             }
             else
             {
                 mensaje = "no se pudo eleminar el grupo Cta Cble: " + info.IdGrupoCble;
                 return(false);
             }
         }
         return(res);
     }
     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());
     }
 }
Ejemplo n.º 5
0
 public void SetInfo(ct_Grupocble_Info _Info)
 {
     try
     {
         Info_Grup_CtaCble = _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());
     }
 }
Ejemplo n.º 6
0
 public Boolean GrabarDB(ct_Grupocble_Info info, ref string mensaje)
 {
     try
     {
         ct_Grupocble_Data data = new ct_Grupocble_Data();
         return(data.GrabarDB(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("", "GrabarDB", ex.Message), ex)
               {
                   EntityType = typeof(ct_Grupocble_Bus)
               };
     }
 }
Ejemplo n.º 7
0
        public Boolean GrabarDB(ct_Grupocble_Info info, ref string mensaje)
        {
            try
            {
                Boolean res = false;
                using (EntitiesDBConta context = new EntitiesDBConta())
                {
                    var Q = from per in context.ct_grupocble
                            where per.IdGrupoCble == info.IdGrupoCble
                            select per;

                    if (Q.ToList().Count == 0)
                    {
                        var address = new ct_grupocble();
                        address.IdGrupoCble          = info.IdGrupoCble;
                        address.gc_GrupoCble         = info.gc_GrupoCble;
                        address.gc_Orden             = Convert.ToByte(info.gc_Orden);
                        address.gc_estado_financiero = info.gc_estado_financiero;
                        address.gc_signo_operacion   = info.gc_signo_operacion;
                        address.Estado = info.Estado;
                        context.ct_grupocble.Add(address);
                        context.SaveChanges();
                        res = true;
                    }
                    else
                    {
                        mensaje = "No se pudo guardar el Grupo Cta Cble: " + info.IdGrupoCble + " ,Por favor revise si ya se encuenta ingresado";
                        return(false);
                    }
                }
                return(res);
            }
            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());
            }
        }
Ejemplo n.º 8
0
 public ct_Grupocble_Info Get_info_grupo()
 {
     try
     {
         if (bei_GrupoCble.EditValue != null)
         {
             info_GrupoCble = lst_GrupoCble.FirstOrDefault(q => q.IdGrupoCble == bei_GrupoCble.EditValue.ToString());
             return(info_GrupoCble);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception ex)
     {
         string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
         MessageBox.Show(NameMetodo + " - " + ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
         return(null);
     }
 }
Ejemplo n.º 9
0
        public List <string> Get_grupo_checked()
        {
            try
            {
                List <string> lista = new List <string>();
                lst_id_GrupoCble_chk = new List <string>();

                var listIdTipoCobro_Cheked = (from CheckedListBoxItem item in cmb_GrupoCble_chk.Items
                                              where item.CheckState == CheckState.Checked
                                              select(string) item.Value).ToArray();

                foreach (var item in listIdTipoCobro_Cheked)
                {
                    lst_id_GrupoCble_chk.Add(item.ToString());
                }
                foreach (var item in lst_id_GrupoCble_chk)
                {
                    ct_Grupocble_Info info_grupo = new ct_Grupocble_Info();
                    info_grupo = lst_GrupoCble.FirstOrDefault(q => q.gc_GrupoCble == item.ToString());
                    if (info_grupo != null)
                    {
                        lista.Add(info_grupo.IdGrupoCble);
                    }
                }


                return(lista);
            }
            catch (Exception ex)
            {
                string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
                MessageBox.Show(NameMetodo + " - " + ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
                return(new List <string>());
            }
        }
Ejemplo n.º 10
0
        public List <ct_Grupocble_Info> Get_list_Grupocble()
        {
            try
            {
                List <ct_Grupocble_Info> lM = new List <ct_Grupocble_Info>();
                EntitiesDBConta          OEGrupocble_Info = new EntitiesDBConta();
                var selectGrupocble = from C in OEGrupocble_Info.ct_grupocble

                                      select C;

                foreach (var item in selectGrupocble)
                {
                    ct_Grupocble_Info Cbt = new ct_Grupocble_Info();
                    Cbt.IdGrupoCble          = item.IdGrupoCble;
                    Cbt.gc_GrupoCble         = item.gc_GrupoCble;
                    Cbt.gc_Orden             = Convert.ToInt32(item.gc_Orden);
                    Cbt.gc_estado_financiero = item.gc_estado_financiero;
                    Cbt.gc_signo_operacion   = Convert.ToInt32(item.gc_signo_operacion);
                    Cbt.Estado = item.Estado;
                    lM.Add(Cbt);
                }

                return(lM);
            }

            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());
            }
        }