Пример #1
0
        public Boolean ActualizarDB(tb_banco_Info Info, ref string msg)
        {
            try
            {
                bool res = false;

                res = oData.ActualizarDB(Info, ref msg);

                foreach (var item in Info.lst_procesos_bancarios_x_empresa)
                {
                    item.IdBanco = Info.IdBanco;
                }
                if (bus_procesos_bancarios_x_empresa.EliminarDB(param.IdEmpresa, Info.IdBanco))
                {
                    res = bus_procesos_bancarios_x_empresa.GuardarDB(Info.lst_procesos_bancarios_x_empresa);
                }

                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("", "ListaBancos", ex.Message), ex)
                      {
                          EntityType = typeof(tb_banco_Bus)
                      };
            }
        }
Пример #2
0
        public ActionResult Nuevo()
        {
            #region Validar Session
            int IdEmpresa = Convert.ToInt32(SessionFixed.IdEmpresa);
            if (string.IsNullOrEmpty(SessionFixed.IdTransaccionSession))
            {
                return(RedirectToAction("Login", new { Area = "", Controller = "Account" }));
            }
            SessionFixed.IdTransaccionSession       = (Convert.ToDecimal(SessionFixed.IdTransaccionSession) + 1).ToString();
            SessionFixed.IdTransaccionSessionActual = SessionFixed.IdTransaccionSession;
            #endregion
            #region Permisos
            seg_Menu_x_Empresa_x_Usuario_Info info = bus_permisos.get_list_menu_accion(Convert.ToInt32(SessionFixed.IdEmpresa), SessionFixed.IdUsuario, "General", "Banco", "Index");
            if (!info.Nuevo)
            {
                return(RedirectToAction("Index"));
            }
            #endregion
            tb_banco_Info model = new tb_banco_Info
            {
                IdEmpresa            = IdEmpresa,
                IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSessionActual),
                Lst_det = new List <tb_banco_procesos_bancarios_x_empresa_Info>()
            };
            List_Det.set_list(model.Lst_det, model.IdTransaccionSession);

            return(View(model));
        }
Пример #3
0
 public Boolean Modificar()
 {
     try
     {
         bool          resultado = false;
         tb_banco_Info Info      = new tb_banco_Info();
         bus_Banco = new tb_banco_Bus();
         Info      = GetBanco(ref mensaje);
         IdBanco   = Convert.ToInt32(Info.IdBanco);
         if (resultado = bus_Banco.ActualizarDB(Info, ref mensaje))
         {
             return(resultado);
         }
         else
         {
             MessageBox.Show("No se guardaron los datos", "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Error);
             return(resultado);
         }
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(ex.ToString());
         throw;
     }
 }
Пример #4
0
 public ActionResult Modificar(int IdBanco = 0)
 {
     #region Validar Session
     if (string.IsNullOrEmpty(SessionFixed.IdTransaccionSession))
     {
         return(RedirectToAction("Login", new { Area = "", Controller = "Account" }));
     }
     SessionFixed.IdTransaccionSession       = (Convert.ToDecimal(SessionFixed.IdTransaccionSession) + 1).ToString();
     SessionFixed.IdTransaccionSessionActual = SessionFixed.IdTransaccionSession;
     #endregion
     #region Permisos
     seg_Menu_x_Empresa_x_Usuario_Info info = bus_permisos.get_list_menu_accion(Convert.ToInt32(SessionFixed.IdEmpresa), SessionFixed.IdUsuario, "General", "Banco", "Index");
     if (!info.Modificar)
     {
         return(RedirectToAction("Index"));
     }
     #endregion
     tb_banco_Info model = bus_banco.get_info(IdBanco);
     if (model == null)
     {
         return(RedirectToAction("Index"));
     }
     model.IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSessionActual);
     model.Lst_det         = bus_banco_det.get_list(Convert.ToInt32(SessionFixed.IdEmpresa), model.IdBanco);
     Session["IdBancoPro"] = IdBanco;
     List_Det.set_list(model.Lst_det, model.IdTransaccionSession);
     return(View(model));
 }
Пример #5
0
        public ActionResult Index()
        {
            #region Validar Session
            if (string.IsNullOrEmpty(SessionFixed.IdTransaccionSession))
            {
                return(RedirectToAction("Login", new { Area = "", Controller = "Account" }));
            }
            SessionFixed.IdTransaccionSession       = (Convert.ToDecimal(SessionFixed.IdTransaccionSession) + 1).ToString();
            SessionFixed.IdTransaccionSessionActual = SessionFixed.IdTransaccionSession;
            #endregion

            #region Permisos
            seg_Menu_x_Empresa_x_Usuario_Info info = bus_permisos.get_list_menu_accion(Convert.ToInt32(SessionFixed.IdEmpresa), SessionFixed.IdUsuario, "General", "Banco", "Index");
            ViewBag.Nuevo = info.Nuevo;
            #endregion

            tb_banco_Info model = new tb_banco_Info
            {
                IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSession),
                IdEmpresa            = Convert.ToInt32(SessionFixed.IdEmpresa)
            };

            var lst = bus_banco.get_list(true);
            Lista_Banco.set_list(lst, model.IdTransaccionSession);
            return(View(model));
        }
Пример #6
0
        public List <tb_banco_Info> Get_List_Banco()
        {
            try
            {
                List <tb_banco_Info> lst = new List <tb_banco_Info>();

                EntitiesGeneral oEnti = new EntitiesGeneral();

                var bancos = from q in oEnti.tb_banco
                             select q;
                foreach (var item in bancos)
                {
                    tb_banco_Info info = new tb_banco_Info();

                    info.IdBanco                   = item.IdBanco;
                    info.ba_descripcion            = item.ba_descripcion;
                    info.Estado                    = item.Estado;
                    info.CodigoLegal               = item.CodigoLegal;
                    info.TieneFormatoTransferencia = item.TieneFormatoTransferencia;
                    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());
            }
        }
Пример #7
0
        public tb_banco_Info get_info(int IdBanco)
        {
            try
            {
                tb_banco_Info info = new tb_banco_Info();
                using (Entities_general Context = new Entities_general())
                {
                    tb_banco Entity = Context.tb_banco.FirstOrDefault(q => q.IdBanco == IdBanco);
                    if (Entity == null)
                    {
                        return(null);
                    }

                    info = new tb_banco_Info
                    {
                        IdBanco                   = Entity.IdBanco,
                        ba_descripcion            = Entity.ba_descripcion,
                        Estado                    = Entity.Estado,
                        CodigoLegal               = Entity.CodigoLegal,
                        TieneFormatoTransferencia = Entity.TieneFormatoTransferencia
                    };
                }
                return(info);
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #8
0
 public Boolean AnulaDB(tb_banco_Info Info, ref string msg)
 {
     try
     {
         Boolean resultado = false;
         using (EntitiesGeneral context = new EntitiesGeneral())
         {
             var address = context.tb_banco.FirstOrDefault(q => q.IdBanco == Info.IdBanco);
             if (address != null)
             {
                 address.Estado = "I";
                 context.SaveChanges();
                 msg       = "Se ha procedido anular el Banco #: " + Info.IdBanco.ToString() + " exitosamente.";
                 resultado = true;
             }
         }
         return(resultado);
     }
     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());
     }
 }
Пример #9
0
 public Boolean GrabarDB(tb_banco_Info Info, ref string msg)
 {
     try
     {
         Boolean resultado = false;
         using (EntitiesGeneral context = new EntitiesGeneral())
         {
             var address = new tb_banco();
             address.IdBanco                   = Info.IdBanco = getId();
             address.ba_descripcion            = Info.ba_descripcion;
             address.Estado                    = Info.Estado;
             address.CodigoLegal               = Info.CodigoLegal;
             address.TieneFormatoTransferencia = Convert.ToBoolean(Info.TieneFormatoTransferencia);
             context.tb_banco.Add(address);
             context.SaveChanges();
             msg       = "Se ha procedido grabar el Banco #: " + address.IdBanco.ToString() + " exitosamente.";
             resultado = true;
         }
         return(resultado);
     }
     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());
     }
 }
Пример #10
0
 public ActionResult Nuevo(tb_banco_Info model)
 {
     if (!bus_banco.guardarDB(model))
     {
         return(View(model));
     }
     return(RedirectToAction("Index"));
 }
Пример #11
0
 public ActionResult Anular(tb_banco_Info model)
 {
     if (!bus_banco.anularDB(model))
     {
         return(View(model));
     }
     return(RedirectToAction("Index"));
 }
Пример #12
0
 public ActionResult Nuevo(tb_banco_Info model)
 {
     model.Lst_det = List_Det.get_list(model.IdTransaccionSession);
     if (!bus_banco.guardarDB(model))
     {
         return(View(model));
     }
     return(RedirectToAction("Consultar", new { IdBanco = model.IdBanco, Exito = true }));
 }
Пример #13
0
 public ActionResult Nuevo(tb_banco_Info model)
 {
     model.Lst_det = List_Det.get_list(model.IdTransaccionSession);
     if (!bus_banco.guardarDB(model))
     {
         return(View(model));
     }
     return(RedirectToAction("Index"));
 }
Пример #14
0
        public ActionResult Anular(int IdBanco = 0)
        {
            tb_banco_Info model = bus_banco.get_info(IdBanco);

            if (model == null)
            {
                return(RedirectToAction("Index"));
            }
            return(View(model));
        }
Пример #15
0
 public bool anularDB(tb_banco_Info info)
 {
     try
     {
         return(odata.anularDB(info));
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #16
0
 public bool modificarDB(tb_banco_Info info)
 {
     try
     {
         return(odata.modificarDB(info));
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #17
0
 public void Set_Banco(tb_banco_Info Info)
 {
     try
     {
         BancoInfo = Info;
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show("Error comunicarse con Sistemas " + ex.Message + " ", "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #18
0
        public Boolean Anular()
        {
            try
            {
                bool resultado = false;
                if (BancoInfo.Estado != "I")
                {
                    if (MessageBox.Show("¿Está seguro que desea anular el Banco # " + txtId.Text.Trim() + " ?", "Anulación de Banco", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        FrmGe_MotivoAnulacion fr = new FrmGe_MotivoAnulacion();
                        fr.ShowDialog();

                        bus_Banco = new tb_banco_Bus();
                        tb_banco_Info Info    = new tb_banco_Info();
                        string        mensaje = string.Empty;

                        Info = GetBanco(ref mensaje);
                        if (mensaje != "")
                        {
                            MessageBox.Show("Error " + mensaje, "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        if (bus_Banco.AnulaDB(Info, ref mensaje))
                        {
                            MessageBox.Show(mensaje, "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            this.ucGe_Menu_Superior_Mant1.Visible_bntGuardar_y_Salir = false;
                            this.ucGe_Menu_Superior_Mant1.Visible_btnGuardar         = false;
                            resultado = true;
                        }
                        else
                        {
                            Log_Error_bus.Log_Error(mensaje.ToString());
                            MessageBox.Show("Error " + mensaje, "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            resultado = false;
                        }
                    }
                    return(resultado);
                }
                else
                {
                    MessageBox.Show("El Banco #: " + txtId.Text.Trim() + " ya se encuentra anulado.", "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return(resultado);
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString());
                throw;
            }
        }
Пример #19
0
 public Boolean AnulaDB(tb_banco_Info Info, ref string msg)
 {
     try
     {
         return(oData.AnulaDB(Info, ref msg));
     }
     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("", "ListaBancos", ex.Message), ex)
               {
                   EntityType = typeof(tb_banco_Bus)
               };
     }
 }
Пример #20
0
        public tb_banco_Info get_info_demanda(int IdBanco)
        {
            tb_banco_Info info = new tb_banco_Info();

            using (Entities_general Contex = new Entities_general())
            {
                info = (from q in Contex.tb_banco
                        where q.IdBanco == IdBanco
                        select new tb_banco_Info
                {
                    IdBanco = q.IdBanco,
                    ba_descripcion = q.ba_descripcion
                }).FirstOrDefault();
            }
            return(info);
        }
Пример #21
0
        void cmb_Banco_EditValueChanged(object sender, EventArgs e)
        {
            try
            {
                tb_banco_Info info_banco = new tb_banco_Info();
                if (ucBa_Proceso_x_Banco1.get_BaCuentaInfo().CodigoLegal == "34")
                {
                    List <ro_Catalogo_Info> info_catalogo = new List <ro_Catalogo_Info>();
                    ro_Catalogo_Bus         bus_catalogo  = new ro_Catalogo_Bus();
                    info_catalogo = bus_catalogo.Get_List_Catalogo_x_Tipo(38);

                    txtCodEmpresa.EditValue = info_catalogo.FirstOrDefault().CodCatalogo;
                }
            }
            catch (Exception ex)
            {
            }
        }
Пример #22
0
        public int get_IdBanco()
        {
            try
            {
                if (cmb_Banco.EditValue != null)
                {
                    InfoBanco = list_Banco_Info.FirstOrDefault(v => v.IdBanco == Convert.ToInt32(cmb_Banco.EditValue));
                }

                return(InfoBanco.IdBanco);
            }
            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(0);
            }
        }
Пример #23
0
 private void ucGe_Menu_Mantenimiento_x_usuario1_event_btnconsultar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         BancoInfo = (tb_banco_Info)this.gridView_Bancos.GetFocusedRow();
         if (BancoInfo == null)
         {
             MessageBox.Show("Para poder continuar por favor seleccione un registro", "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
         else
         {
             Preparar_Formulario(Cl_Enumeradores.eTipo_action.consultar);
         }
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show("Error comunicarse con Sistemas " + ex.Message + " ", "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #24
0
        public ActionResult Nuevo()
        {
            #region Validar Session
            int IdEmpresa = Convert.ToInt32(SessionFixed.IdEmpresa);
            if (string.IsNullOrEmpty(SessionFixed.IdTransaccionSession))
            {
                return(RedirectToAction("Login", new { Area = "", Controller = "Account" }));
            }
            SessionFixed.IdTransaccionSession       = (Convert.ToDecimal(SessionFixed.IdTransaccionSession) + 1).ToString();
            SessionFixed.IdTransaccionSessionActual = SessionFixed.IdTransaccionSession;
            #endregion
            tb_banco_Info model = new tb_banco_Info
            {
                IdEmpresa            = IdEmpresa,
                IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSessionActual),
                Lst_det = new List <tb_banco_procesos_bancarios_x_empresa_Info>()
            };
            List_Det.set_list(model.Lst_det, model.IdTransaccionSession);

            return(View(model));
        }
Пример #25
0
 public bool anularDB(tb_banco_Info info)
 {
     try
     {
         using (Entities_general Context = new Entities_general())
         {
             tb_banco Entity = Context.tb_banco.FirstOrDefault(q => q.IdBanco == info.IdBanco);
             if (Entity == null)
             {
                 return(false);
             }
             Entity.Estado = info.Estado = "I";
             Context.SaveChanges();
         }
         return(true);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #26
0
        public ActionResult Consultar(int IdBanco = 0, bool Exito = false)
        {
            #region Validar Session
            if (string.IsNullOrEmpty(SessionFixed.IdTransaccionSession))
            {
                return(RedirectToAction("Login", new { Area = "", Controller = "Account" }));
            }
            SessionFixed.IdTransaccionSession       = (Convert.ToDecimal(SessionFixed.IdTransaccionSession) + 1).ToString();
            SessionFixed.IdTransaccionSessionActual = SessionFixed.IdTransaccionSession;
            #endregion

            tb_banco_Info model = bus_banco.get_info(IdBanco);
            if (model == null)
            {
                return(RedirectToAction("Index"));
            }

            #region Permisos
            seg_Menu_x_Empresa_x_Usuario_Info info = bus_permisos.get_list_menu_accion(Convert.ToInt32(SessionFixed.IdEmpresa), SessionFixed.IdUsuario, "General", "Banco", "Index");
            if (model.Estado == "I")
            {
                info.Modificar = false;
                info.Anular    = false;
            }
            model.Nuevo     = (info.Nuevo == true ? 1 : 0);
            model.Modificar = (info.Modificar == true ? 1 : 0);
            model.Anular    = (info.Anular == true ? 1 : 0);
            #endregion

            if (Exito)
            {
                ViewBag.MensajeSuccess = MensajeSuccess;
            }

            model.IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSessionActual);
            model.Lst_det         = bus_banco_det.get_list(Convert.ToInt32(SessionFixed.IdEmpresa), model.IdBanco);
            Session["IdBancoPro"] = IdBanco;
            List_Det.set_list(model.Lst_det, model.IdTransaccionSession);
            return(View(model));
        }
Пример #27
0
        private void cmbBanco_EditValueChanged(object sender, EventArgs e)
        {
            try
            {
                tb_banco_Info info_banco = new tb_banco_Info();

                if (info_banco == null)
                {
                    info_banco = lstBanco.Where(v => v.CodigoLegal == _Info.IdBanco).FirstOrDefault();
                }
                if (info_banco.CodigoLegal == "34")
                {
                    List <ro_Catalogo_Info> info_catalogo = new List <ro_Catalogo_Info>();
                    ro_Catalogo_Bus         bus_catalogo  = new ro_Catalogo_Bus();
                    info_catalogo = bus_catalogo.Get_List_Catalogo_x_Tipo(38);

                    txtCodEmpresa.EditValue = info_catalogo.FirstOrDefault().CodCatalogo;
                }
            }
            catch (Exception ex)
            {
            }
        }
Пример #28
0
        public tb_banco_Info GetBanco(ref string mensaje)
        {
            try
            {
                tb_banco_Info Info = new tb_banco_Info();

                Info.IdBanco                   = Convert.ToInt32(txtId.Text);
                Info.ba_descripcion            = txtNombre.Text;
                Info.Estado                    = (chkEstado.Checked == true) ? "A" : "I";
                Info.CodigoLegal               = txtCodigoLegal.Text;
                Info.TieneFormatoTransferencia = chkFormatoTransfer.Checked;

                Info.lst_procesos_bancarios_x_empresa = Get_procesos_x_banco();

                return(Info);
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                mensaje = ex.Message.ToString();
                MessageBox.Show("Error " + mensaje, "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Information);
                throw new Exception();
            }
        }
Пример #29
0
 public bool guardarDB(tb_banco_Info info)
 {
     try
     {
         using (Entities_general Context = new Entities_general())
         {
             tb_banco Entity = new tb_banco
             {
                 IdBanco                   = info.IdBanco = get_id(),
                 ba_descripcion            = info.ba_descripcion,
                 Estado                    = info.Estado = "A",
                 CodigoLegal               = info.CodigoLegal,
                 TieneFormatoTransferencia = info.TieneFormatoTransferencia
             };
             Context.tb_banco.Add(Entity);
             Context.SaveChanges();
         }
         return(true);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #30
0
        public bool modificarDB(tb_banco_Info info)
        {
            try
            {
                using (Entities_general Context = new Entities_general())
                {
                    tb_banco Entity = Context.tb_banco.FirstOrDefault(q => q.IdBanco == info.IdBanco);
                    if (Entity == null)
                    {
                        return(false);
                    }
                    Entity.CodigoLegal               = info.CodigoLegal;
                    Entity.ba_descripcion            = info.ba_descripcion;
                    Entity.TieneFormatoTransferencia = info.TieneFormatoTransferencia;
                    Context.SaveChanges();
                }

                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }