Exemplo n.º 1
0
 public Boolean AnularBD(fa_descuento_Info Info, ref string mensaje)
 {
     try
     {
         bool resultado           = false;
         EntitiesFacturacion Base = new EntitiesFacturacion();
         var Descuento            = Base.fa_descuento.FirstOrDefault(a => a.IdEmpresa == Info.IdEmpresa && a.IdDescuento == Info.IdDescuento);
         if (Descuento != null)
         {
             Descuento.Estado          = false;
             Descuento.Fecha_UltAnu    = Info.Fecha_UltAnu;
             Descuento.IdUsuarioUltAnu = Info.IdUsuarioUltAnu;
             Descuento.MotiAnula       = Info.MotiAnula;
             Descuento.ip     = Info.ip;
             Descuento.nom_pc = Info.nom_pc;
             Base.SaveChanges();
             resultado = true;
         }
         return(resultado);
     }
     catch (Exception ex)
     {
         string arreglo      = ToString();
         string MensajeError = string.Empty;
         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);
         MensajeError = ex.InnerException + " " + ex.Message;
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);
         throw new Exception(ex.InnerException.ToString());
     }
 }
Exemplo n.º 2
0
 private void ucGe_Menu_Mantenimiento_x_usuario1_event_btnAnular_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         Info = (fa_descuento_Info)this.gridViewDescuento.GetFocusedRow();
         if (Info == null)
         {
             MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Por_favor_seleccione_item_a_anular), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
         else
         {
             if (Info.Estado != false)
             {
                 llama_formulario(Cl_Enumeradores.eTipo_action.Anular);
             }
             else
             {
                 MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.El_registro_se_encuentra_anulado), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             }
         }
     }
     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());
     }
 }
Exemplo n.º 3
0
        public Aca_Beca_Info GetInfo()
        {
            Aca_Beca_Info rInfo = new Aca_Beca_Info();

            try
            {
                rInfo.IdInstitucion = param.IdInstitucion;
                rInfo.IdBeca        = (txtIdBeca.Text == "") ? 0 : Convert.ToInt32(txtIdBeca.Text);
                rInfo.nom_beca      = txt_descripcion.Text;
                rInfo.porcentaje    = Convert.ToDouble(txt_porcentaje.Text);
                fa_descuento_Info   = List_fa_descuento_Info.FirstOrDefault(v => v.IdDescuento == Convert.ToDecimal(cmb_FaDescuento.EditValue));

                rInfo.estado          = (chkActivo.Checked == true) ? "A" : "I";
                rInfo.IdUsuarioUltMod = param.IdUsuario;
                rInfo.IdEmpresa       = param.IdEmpresa;
                rInfo.IdDescuento     = Convert.ToDecimal(cmb_FaDescuento.EditValue);
                //rInfo.IdRubro = Convert.ToInt32(Rubro.get_item());
            }
            catch (Exception ex)
            {
                string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
                NameMetodo = NameMetodo + " - " + ex.ToString();
                Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
                MessageBox.Show(NameMetodo + " " + param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas)
                                , param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(rInfo);
        }
        private void gridView_descuento_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
        {
            try
            {
                fa_factura_det_x_fa_descuento_Info row = (fa_factura_det_x_fa_descuento_Info)gridView_descuento.GetRow(e.RowHandle);
                if (row == null)
                {
                    return;
                }

                if (e.Column == col_IdDescuento)
                {
                    fa_descuento_Info info_descuento = lst_descuento.FirstOrDefault(q => q.IdDescuento == row.IdDescuento);
                    if (info_descuento != null)
                    {
                        row.de_porcentaje = info_descuento.de_porcentaje;
                        row.de_valor      = info_factura_det.vt_Precio * Convert.ToDouble(row.de_porcentaje / 100);
                    }
                }

                calcular();
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 5
0
 public void set_Info(fa_descuento_Info _Info)
 {
     try
     {
         descuento_Info = _Info;
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) + ex.Message + " ", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemplo n.º 6
0
 public Boolean AnularBD(fa_descuento_Info Info, ref string mensaje)
 {
     try
     {
         return(da.AnularBD(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("", "AnularBD", ex.Message), ex)
               {
                   EntityType = typeof(fa_descuento_Bus)
               };
     }
 }
Exemplo n.º 7
0
 public List <fa_descuento_Info> Get_Lista_Descuento(int IdEmpresa, ref string mensaje)
 {
     try
     {
         List <fa_descuento_Info> Lista = new List <fa_descuento_Info>();
         EntitiesFacturacion      Base  = new EntitiesFacturacion();
         var Select = from q in Base.fa_descuento
                      where q.IdEmpresa == IdEmpresa
                      select q;
         if (Select != null)
         {
             foreach (var item in Select)
             {
                 fa_descuento_Info Info = new fa_descuento_Info();
                 Info.IdEmpresa      = item.IdEmpresa;
                 Info.IdDescuento    = item.IdDescuento;
                 Info.de_IdCtaCble   = item.de_IdCtaCble;
                 Info.de_nombre      = item.de_nombre;
                 Info.de_observacion = item.de_observacion;
                 Info.de_porcentaje  = item.de_porcentaje;
                 if (item.Estado == true)
                 {
                     Info.estado = 'A';
                 }
                 else
                 {
                     Info.estado = 'I';
                 }
                 Info.Estado = item.Estado;
                 Lista.Add(Info);
             }
         }
         return(Lista);
     }
     catch (Exception ex)
     {
         string arreglo      = ToString();
         string MensajeError = string.Empty;
         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);
         MensajeError = ex.InnerException + " " + ex.Message;
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);
         throw new Exception(ex.ToString());
     }
 }
Exemplo n.º 8
0
 void Limpiar()
 {
     try
     {
         descuento_Info               = new fa_descuento_Info();
         txtDescuento.Text            = string.Empty;
         txt_Nombre.Text              = string.Empty;
         Txt_ObservacionDsc.Text      = string.Empty;
         txt_PorecentajeDsc.EditValue = null;
         ucCon_PlanCtaCmb1.Inicializar_cmbPlanCta();
     }
     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());
     }
 }
Exemplo n.º 9
0
        public Boolean GrabarBD(fa_descuento_Info Info, ref string mensaje)
        {
            try
            {
                bool resultado           = false;
                int  IdEmpresa           = 0;
                EntitiesFacturacion Base = new EntitiesFacturacion();
                {
                    fa_descuento Entity = new fa_descuento();
                    Entity.IdEmpresa         = IdEmpresa = Info.IdEmpresa;
                    Entity.IdDescuento       = getId(IdEmpresa);
                    Entity.de_IdCtaCble      = Info.de_IdCtaCble;
                    Entity.de_nombre         = Info.de_nombre;
                    Entity.de_observacion    = Info.de_observacion;
                    Entity.de_porcentaje     = Info.de_porcentaje;
                    Entity.Estado            = true;
                    Entity.FechaCreacion     = Info.FechaCreacion;
                    Entity.IdUsuarioCreacion = Info.IdUsuarioCreacion;
                    Entity.ip     = Info.ip;
                    Entity.nom_pc = Info.nom_pc;
                    Base.fa_descuento.Add(Entity);
                    Base.SaveChanges();
                    resultado = true;
                }
                return(resultado);
            }

            catch (Exception ex)
            {
                string arreglo      = ToString();
                string MensajeError = string.Empty;
                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);
                MensajeError = ex.InnerException + " " + ex.Message;
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);
                throw new Exception(ex.InnerException.ToString());
            }
        }
Exemplo n.º 10
0
 private void Get_Info()
 {
     try
     {
         descuento_Info                = new fa_descuento_Info();
         descuento_Info.IdDescuento    = Convert.ToDecimal(txtDescuento.EditValue);
         descuento_Info.IdEmpresa      = param.IdEmpresa;
         descuento_Info.de_nombre      = txt_Nombre.Text;
         descuento_Info.de_IdCtaCble   = ucCon_PlanCtaCmb1.get_PlanCtaInfo().IdCtaCble;
         descuento_Info.de_porcentaje  = Convert.ToDouble(txt_PorecentajeDsc.EditValue);
         descuento_Info.de_observacion = Txt_ObservacionDsc.Text;
         descuento_Info.Estado         = true;
         descuento_Info.ip             = param.ip;
         descuento_Info.nom_pc         = param.nom_pc;
     }
     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());
     }
 }
Exemplo n.º 11
0
 private void cmb_FaDescuento_EditValueChanged(object sender, EventArgs e)
 {
     fa_descuento_Info    = List_fa_descuento_Info.FirstOrDefault(v => v.IdDescuento == Convert.ToDecimal(cmb_FaDescuento.EditValue));
     txt_porcentaje.Text  = fa_descuento_Info.de_porcentaje.ToString();
     txt_descripcion.Text = fa_descuento_Info.de_nombre;
 }