public Boolean GuardarDB(tb_tarjeta_parametro_Info Info)
        {
            try
            {
                EntitiesGeneral context = new EntitiesGeneral();
                var             tarjeta = new tb_tarjeta_parametro();

                tarjeta.IdTarjeta             = Info.IdTarjeta;
                tarjeta.IdEmpresa             = Info.IdEmpresa;
                tarjeta.IdTarjeta             = Info.IdTarjeta;
                tarjeta.IdCtaCble_Tarj        = Info.IdCtaCble_Tarj;
                tarjeta.IdCobro_tipo_x_Tarj   = Info.IdCobro_tipo_x_Tarj;
                tarjeta.IdCobro_tipo_x_RetFu  = Info.IdCobro_tipo_x_RetFu;
                tarjeta.IdCobro_tipo_x_RetIva = Info.IdCobro_tipo_x_RetIva;
                tarjeta.IdCtaCble_Comision    = Info.IdCtaCble_Comision;
                tarjeta.Porcetaje_Comision    = Info.Porcetaje_Comision;
                context.tb_tarjeta_parametro.Add(tarjeta);
                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.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
 public tb_tarjeta_parametro_Info Get_Info_tarjeta_parametro(int IdTarjeta, int IdEmpresa)
 {
     try
     {
         EntitiesGeneral           context = new EntitiesGeneral();
         tb_tarjeta_parametro_Info info    = new tb_tarjeta_parametro_Info();
         var tarjeta = context.tb_tarjeta_parametro.FirstOrDefault(var => var.IdTarjeta == IdTarjeta && var.IdEmpresa == IdEmpresa);
         if (tarjeta != null)
         {
             info.IdEmpresa             = tarjeta.IdEmpresa;
             info.IdTarjeta             = tarjeta.IdTarjeta;
             info.IdCtaCble_Tarj        = tarjeta.IdCtaCble_Tarj;
             info.IdCobro_tipo_x_Tarj   = tarjeta.IdCobro_tipo_x_Tarj;
             info.IdCobro_tipo_x_RetFu  = tarjeta.IdCobro_tipo_x_RetFu;
             info.IdCobro_tipo_x_RetIva = tarjeta.IdCobro_tipo_x_RetIva;
             info.IdCtaCble_Comision    = tarjeta.IdCtaCble_Comision;
             info.Porcetaje_Comision    = Convert.ToDouble(tarjeta.Porcetaje_Comision);
         }
         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.ToString() + " " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }
 void LimpiarDatos()
 {
     try
     {
         _Accion = Cl_Enumeradores.eTipo_action.grabar;
         ucGe_Menu.Visible_bntGuardar_y_Salir = true;
         ucGe_Menu.Visible_btnGuardar         = true;
         txtDescripcion.Enabled    = true;
         cmbBanco.Enabled          = true;
         ckEstado.Enabled          = false;
         cmbCobroTipo.Enabled      = true;
         ucCon_PlanCtaCmb2.Enabled = true;
         ucCon_PlanCtaCmb1.Enabled = true;
         cmbRetFuente.Enabled      = true;
         cmbRetIva.Enabled         = true;
         txtComision.Enabled       = true;
         ckEstado.Checked          = true;
         txtId.Text             = "";
         txtDescripcion.Text    = "";
         cmbCobroTipo.EditValue = "";
         ucCon_PlanCtaCmb2.Inicializar_cmbPlanCta();
         ucCon_PlanCtaCmb1.Inicializar_cmbPlanCta();
         cmbRetFuente.EditValue = "";
         cmbRetIva.EditValue    = "";
         txtComision.EditValue  = "";
         Info          = new tb_tarjeta_Info();
         InfoParametro = new tb_tarjeta_parametro_Info();
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #4
0
 public Boolean ModificarDB(tb_tarjeta_parametro_Info Info)
 {
     try
     {
         return(data.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("", "Modificar", ex.Message), ex)
               {
                   EntityType = typeof(tb_tarjeta_parametro_Bus)
               };
     }
 }
        public List <tb_tarjeta_parametro_Info> Get_List_tarjeta_parametro()
        {
            try
            {
                List <tb_tarjeta_parametro_Info> lst = new List <tb_tarjeta_parametro_Info>();

                EntitiesGeneral oEnti = new EntitiesGeneral();



                var tarjetas = from q in oEnti.tb_tarjeta_parametro
                               select q;

                foreach (var item in tarjetas)
                {
                    tb_tarjeta_parametro_Info info = new tb_tarjeta_parametro_Info();
                    info.IdEmpresa             = item.IdEmpresa;
                    info.IdTarjeta             = item.IdTarjeta;
                    info.IdCtaCble_Tarj        = item.IdCtaCble_Tarj;
                    info.IdCobro_tipo_x_RetFu  = item.IdCobro_tipo_x_RetFu;
                    info.IdCobro_tipo_x_RetIva = item.IdCobro_tipo_x_RetIva;
                    info.IdCtaCble_Comision    = item.IdCtaCble_Comision;
                    info.Porcetaje_Comision    = Convert.ToDouble(item.Porcetaje_Comision);
                    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.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }