コード例 #1
0
        public List <cxc_catalogo_Info> Get_List_catalogo()
        {
            try
            {
                List <cxc_catalogo_Info> lista = new List <cxc_catalogo_Info>();
                EntitiesCuentas_x_Cobrar oEnt  = new EntitiesCuentas_x_Cobrar();

                var select = from q in oEnt.cxc_Catalogo
                             select q;

                foreach (var item in select)
                {
                    cxc_catalogo_Info info = new cxc_catalogo_Info();
                    info.IdCatalogo = item.IdCatalogo;
                    info.Nombre     = item.Nombre;
                    lista.Add(info);
                }
                return(lista);
            }
            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.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
コード例 #2
0
        public List <cxc_catalogo_Info> Get_List_IdTipoLista(string cod)
        {
            try
            {
                List <cxc_catalogo_Info> lista = new List <cxc_catalogo_Info>();

                EntitiesCuentas_x_Cobrar context = new EntitiesCuentas_x_Cobrar();
                var Existe = from q in context.cxc_Catalogo
                             where q.IdCatalogo_tipo == cod
                             select q;

                foreach (var item in Existe)
                {
                    cxc_catalogo_Info info = new cxc_catalogo_Info();

                    info.IdCatalogo      = item.IdCatalogo;
                    info.IdCatalogo_tipo = item.IdCatalogo_tipo;
                    info.Nombre          = item.Nombre;
                    info.Orden           = (int)item.Orden;
                    info.Estado          = item.Estado;
                    lista.Add(info);
                }
                return(lista);
            }
            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.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
コード例 #3
0
 public Boolean AnularDB(cxc_catalogo_Info Info)
 {
     try
     {
         Boolean res = false;
         using (EntitiesCuentas_x_Cobrar context = new EntitiesCuentas_x_Cobrar())
         {
             var contact = context.cxc_Catalogo.FirstOrDefault(var => var.IdCatalogo == Info.IdCatalogo && var.IdCatalogo_tipo == Info.IdCatalogo_tipo);
             if (contact != null)
             {
                 contact.Estado          = "I";
                 contact.IdUsuarioUltMod = Info.IdUsuarioUltMod;
                 contact.FechaUltMod     = Info.FechaUltMod;
                 context.SaveChanges();
                 res = true;
             }
         }
         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() + " " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }
コード例 #4
0
 public Boolean GuardarDB(cxc_catalogo_Info Info)
 {
     try
     {
         using (EntitiesCuentas_x_Cobrar Context = new EntitiesCuentas_x_Cobrar())
         {
             var Address = new cxc_Catalogo();
             Address.IdCatalogo      = Info.IdCatalogo;
             Address.IdCatalogo_tipo = Info.IdCatalogo_tipo;
             Address.Nombre          = Info.Nombre;
             Address.Estado          = "A";
             Address.Orden           = Info.Orden;
             Address.IdUsuario       = Info.IdUsuario;
             Address.nom_pc          = Info.nom_pc;
             Address.ip = Info.ip;
             Context.cxc_Catalogo.Add(Address);
             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.InnerException + " " + ex.Message;
         throw new Exception(ex.InnerException.ToString());
     }
 }
コード例 #5
0
        public cxc_catalogo_Info Get_Info_catalogo(string id)
        {
            try
            {
                EntitiesCuentas_x_Cobrar context = new EntitiesCuentas_x_Cobrar();
                cxc_catalogo_Info        Info    = new cxc_catalogo_Info();
                var contenido = context.cxc_Catalogo.First(var => var.IdCatalogo == id);

                Info.IdCatalogo      = contenido.IdCatalogo;
                Info.IdCatalogo_tipo = contenido.IdCatalogo_tipo;
                Info.Nombre          = contenido.Nombre;
                Info.Estado          = contenido.Estado;
                Info.Orden           = (int)contenido.Orden;
                return(Info);
            }
            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.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
コード例 #6
0
ファイル: cxc_catalogo_Bus.cs プロジェクト: arocajorge/ERPFJ
 public Boolean GuardarDB(cxc_catalogo_Info Info)
 {
     try { return(Data.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("", "GuardarDB", ex.Message), ex)
               {
                   EntityType = typeof(cxc_catalogo_Bus)
               };
     }
 }
コード例 #7
0
 void LimpiarDatos()
 {
     try
     {
         _Accion             = Cl_Enumeradores.eTipo_action.grabar;
         _Info               = new cxc_catalogo_Info();
         txtOrden.Value      = 0;
         txtDescripcion.Text = "";
         txtId.Text          = "";
         cbxEstado.Checked   = true;
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
コード例 #8
0
        public cxc_catalogo_Info get_CatalogosInfo()
        {
            try
            {
                if (cmbCatalogo.EditValue != null)
                {
                    InfoCatalogo = listCatalogo.First(v => v.IdCatalogo == Convert.ToString(cmbCatalogo.EditValue));
                }

                return(InfoCatalogo);
            }
            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);
            }
        }
コード例 #9
0
        public List <cxc_catalogo_Info> Get_List_Catalogo(string IdCatalogo_tipo)
        {
            try
            {
                EntitiesCuentas_x_Cobrar context = new EntitiesCuentas_x_Cobrar();

                var lista = from q in context.cxc_Catalogo
                            where q.IdCatalogo_tipo == IdCatalogo_tipo
                            select q;

                List <cxc_catalogo_Info> lst = new List <cxc_catalogo_Info>();
                cxc_catalogo_Info        Info;

                foreach (var item in lista)
                {
                    Info                 = new cxc_catalogo_Info();
                    Info.IdCatalogo      = item.IdCatalogo;
                    Info.IdCatalogo_tipo = item.IdCatalogo_tipo;
                    Info.Nombre          = item.Nombre;
                    Info.Estado          = item.Estado;
                    Info.Orden           = Convert.ToInt32(item.Orden);
                    Info.IdUsuario       = item.IdUsuario;
                    Info.IdUsuarioUltMod = item.IdUsuarioUltMod;
                    Info.FechaUltMod     = Convert.ToDateTime(item.FechaUltMod);
                    Info.nom_pc          = item.nom_pc;
                    Info.ip              = item.ip;
                    lst.Add(Info);
                }

                return(lst);
            }
            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.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
コード例 #10
0
//

        Boolean Validar()
        {
            try
            {
                if (this.txtId.Text == "")
                {
                    MessageBox.Show("Ingrese el código. Por favor", "Sistemas");
                    return(false);
                }
                else
                {
                    cxc_catalogo_Info tiporeg = new cxc_catalogo_Info();
                    tiporeg = cmbTipoRegGene.get_CatalogosInfo();
                    if (tiporeg == null || tiporeg.IdCatalogo == null)
                    {
                        MessageBox.Show("Escoja el Tipo de registo q genera", "Sistemas");
                        return(false);
                    }

                    if (cmb_motivo.EditValue == null)
                    {
                        MessageBox.Show("Escoja el Tipo de cobro", "Sistemas");
                        return(false);
                    }
                    else
                    {
                        if (this.txtDescripcion.Text == "")
                        {
                            MessageBox.Show("Ingrese el nombre del tipo de cobro. Por favor", "Sistemas");
                            return(false);
                        }

                        else
                        {
                            if (cmbTipoRegGene.get_CatalogosInfo() == null)
                            {
                                MessageBox.Show("Por favor ingrese el tipo de registro a generar.", "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                return(false);
                            }

                            else
                            {
                                if (this.cmbEstadoCobro.EditValue == null)
                                {
                                    MessageBox.Show("Ingrese el estado del cobro. Por favor", "Sistemas");
                                    return(false);
                                }

                                else
                                {
                                    double porc = Convert.ToDouble(this.txtPorcReten.EditValue);

                                    if (this.chbRetenFTE.Checked == true || this.chbRetenFTE.Checked == true)
                                    {
                                        if (porc == 0)
                                        {
                                            MessageBox.Show("Ingrese el porcentaje de retención. Por favor", "Sistemas");
                                            return(false);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                return(true);
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }
        }