public ActionResult Nuevo(caj_Caja_Movimiento_Info model)
        {
            #region Validaciones
            model.lst_ct_cbtecble_det = list_ct_cbtecble_det.get_list(model.IdTransaccionSession);
            if (!validar(model, ref mensaje))
            {
                cargar_combos(model.IdEmpresa);
                ViewBag.mensaje = mensaje;
                return(View(model));
            }
            model.IdUsuario = SessionFixed.IdUsuario;
            caj_parametro_Info i_parametro = bus_caj_param.get_info(model.IdEmpresa);
            if (i_parametro == null)
            {
                cargar_combos(model.IdEmpresa);
                ViewBag.mensaje = "Debe ingresar los parámetros para usar el módulo";
                return(View(model));
            }
            model.IdTipocbte = i_parametro.IdTipoCbteCble_MoviCaja_Egr;
            model.cm_Signo   = "-";
            #endregion

            #region guardar
            if (!bus_caja_mov.guardarDB(model))
            {
                cargar_combos(model.IdEmpresa);
                return(View(model));
            }
            #endregion

            return(RedirectToAction("Modificar", new { IdEmpresa = model.IdEmpresa, IdTipocbte = model.IdTipocbte, IdCbteCble = model.IdCbteCble, Exito = true }));
        }
Beispiel #2
0
        public Boolean ModificarDB(caj_parametro_Info info, List <caj_Caja_Movimiento_Tipo_x_CtaCble_Info> LstTipoxCta)
        {
            try
            {
                using (EntitiesCaja context = new EntitiesCaja())
                {
                    EntitiesCaja param         = new EntitiesCaja();
                    var          selectBaParam = (from C in param.caj_parametro
                                                  where C.IdEmpresa == info.IdEmpresa
                                                  select C).Count();

                    if (selectBaParam == 0)
                    {
                        var addressG = new caj_parametro();
                        addressG.IdEmpresa     = info.IdEmpresa;
                        addressG.Fecha_Transac = info.Fecha_Transac;
                        addressG.IdUsuario     = info.IdUsuario;
                        addressG.IdTipoCbteCble_MoviCaja_Egr     = info.IdTipoCbteCble_MoviCaja_Egr;
                        addressG.IdTipoCbteCble_MoviCaja_Ing     = info.IdTipoCbteCble_MoviCaja_Ing;
                        addressG.IdTipoCbteCble_MoviCaja_Ing_Anu = info.IdTipoCbteCble_MoviCaja_Ing_Anu;
                        addressG.IdTipoCbteCble_MoviCaja_Egr_Anu = info.IdTipoCbteCble_MoviCaja_Egr_Anu;
                        addressG.IdTipo_movi_ing_x_reposicion    = info.IdTipo_movi_ing_x_reposicion;
                        context.caj_parametro.Add(addressG);
                        context.SaveChanges();
                    }
                    else
                    {
                        var contact = context.caj_parametro.FirstOrDefault(para => para.IdEmpresa == info.IdEmpresa);
                        if (contact != null)
                        {
                            contact.IdTipoCbteCble_MoviCaja_Egr     = info.IdTipoCbteCble_MoviCaja_Egr;
                            contact.IdTipoCbteCble_MoviCaja_Ing     = info.IdTipoCbteCble_MoviCaja_Ing;
                            contact.IdTipoCbteCble_MoviCaja_Ing_Anu = info.IdTipoCbteCble_MoviCaja_Ing_Anu;
                            contact.IdTipoCbteCble_MoviCaja_Egr_Anu = info.IdTipoCbteCble_MoviCaja_Egr_Anu;
                            contact.IdTipo_movi_ing_x_reposicion    = info.IdTipo_movi_ing_x_reposicion;
                            contact.FechaUltMod     = info.FechaUltMod;
                            contact.IdUsuarioUltMod = info.IdUsuarioUltMod;
                            context.SaveChanges();
                        }
                    }

                    //graba las cuentas por tipo de movimiento de caja

                    caj_Caja_Movimiento_Tipo_x_CtaCble_Data data = new caj_Caja_Movimiento_Tipo_x_CtaCble_Data();

                    data.GrabarDB(LstTipoxCta);
                }
                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.ToString());
            }
        }
Beispiel #3
0
        public ActionResult Nuevo(caj_Caja_Movimiento_Info model)
        {
            #region Validaciones
            model.lst_ct_cbtecble_det = list_ct_cbtecble_det.get_list(model.IdTransaccionSession);
            if (!validar(model, ref mensaje))
            {
                cargar_combos(model.IdEmpresa);
                ViewBag.mensaje = mensaje;
                return(View(model));
            }
            model.IdUsuario = Session["IdUsuario"].ToString();
            caj_parametro_Info i_parametro = bus_caj_param.get_info(model.IdEmpresa);
            if (i_parametro == null)
            {
                cargar_combos(model.IdEmpresa);
                ViewBag.mensaje = "Debe ingresar los parámetros para usar el módulo";
                return(View(model));
            }
            model.IdTipocbte = i_parametro.IdTipoCbteCble_MoviCaja_Ing;
            model.cm_Signo   = "+";
            #endregion

            #region guardar
            if (!bus_caja_mov.guardarDB(model))
            {
                cargar_combos(model.IdEmpresa);
                return(View(model));
            }
            #endregion

            return(RedirectToAction("Index"));
        }
Beispiel #4
0
        public caj_parametro_Info Get_Info_Parametro(int IdEmpresa)
        {
            caj_parametro_Info info    = new caj_parametro_Info();
            EntitiesCaja       context = new EntitiesCaja();

            try
            {
                var x = from q in context.caj_parametro where q.IdEmpresa == IdEmpresa select q;
                foreach (var item in x)
                {
                    info.IdEmpresa = item.IdEmpresa;
                    info.IdTipoCbteCble_MoviCaja_Egr     = item.IdTipoCbteCble_MoviCaja_Egr;
                    info.IdTipoCbteCble_MoviCaja_Egr_Anu = item.IdTipoCbteCble_MoviCaja_Egr_Anu;
                    info.IdTipoCbteCble_MoviCaja_Ing     = item.IdTipoCbteCble_MoviCaja_Ing;
                    info.IdTipoCbteCble_MoviCaja_Ing_Anu = item.IdTipoCbteCble_MoviCaja_Ing_Anu;
                    info.IdTipo_movi_ing_x_reposicion    = item.IdTipo_movi_ing_x_reposicion;
                }
                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.ToString());
            }
        }
Beispiel #5
0
 public caj_parametro_Info get_info(int IdEmpresa)
 {
     try
     {
         caj_parametro_Info info = new caj_parametro_Info();
         using (Entities_caja Context = new Entities_caja())
         {
             caj_parametro Entity = Context.caj_parametro.FirstOrDefault(q => q.IdEmpresa == IdEmpresa);
             if (Entity == null)
             {
                 return(null);
             }
             info = new caj_parametro_Info
             {
                 IdEmpresa = Entity.IdEmpresa,
                 IdTipoCbteCble_MoviCaja_Egr  = Entity.IdTipoCbteCble_MoviCaja_Egr,
                 IdTipoCbteCble_MoviCaja_Ing  = Entity.IdTipoCbteCble_MoviCaja_Ing,
                 IdTipo_movi_ing_x_reposicion = Entity.IdTipo_movi_ing_x_reposicion,
                 DiasTransaccionesAFuturo     = Entity.DiasTransaccionesAFuturo,
                 DiasTransaccionesAPasado     = Entity.DiasTransaccionesAPasado
             };
         }
         return(info);
     }
     catch (Exception)
     {
         throw;
     }
 }
 public bool guardarDB(caj_parametro_Info info)
 {
     try
     {
         return(odata.guardarDB(info));
     }
     catch (Exception)
     {
         throw;
     }
 }
 public ActionResult Index(caj_parametro_Info model)
 {
     model.IdUsuario       = SessionFixed.IdUsuario;
     model.IdUsuarioUltMod = SessionFixed.IdUsuario;
     if (!bus_parametro.guardarDB(model))
     {
         ViewBag.mensaje = "No se pudieron actualizar los registros";
     }
     cargar_combos(model.IdEmpresa);
     return(View(model));
 }
Beispiel #8
0
 public Boolean ModificarDB(caj_parametro_Info info, List <caj_Caja_Movimiento_Tipo_x_CtaCble_Info> LstTipoxCta)
 {
     try
     {
         return(data.ModificarDB(info, LstTipoxCta));
     }
     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(caj_parametro_Bus)
               };
     }
 }
        public ActionResult Index()
        {
            int IdEmpresa            = Convert.ToInt32(SessionFixed.IdEmpresa);
            caj_parametro_Info model = bus_parametro.get_info(IdEmpresa);

            if (model == null)
            {
                model = new caj_parametro_Info {
                    IdEmpresa = IdEmpresa
                }
            }
            ;
            cargar_combos(IdEmpresa);
            return(View(model));
        }
Beispiel #10
0
        private void set()
        {
            try
            {
                ParamCaja_I = parameCaja_B.Get_Info_Parametro(param.IdEmpresa);

                ultraCmbE_TipoCbte_Ingreso.set_TipoCbteCble(ParamCaja_I.IdTipoCbteCble_MoviCaja_Ing);
                ultraCmbE_TipoCbte_AnulaEgreso.set_TipoCbteCble(ParamCaja_I.IdTipoCbteCble_MoviCaja_Egr_Anu);
                ultraCmbE_TipoCbte_AnulaIngreso.set_TipoCbteCble(ParamCaja_I.IdTipoCbteCble_MoviCaja_Ing_Anu);
                ultraCmbE_TipoCbte_Egreso.set_TipoCbteCble(ParamCaja_I.IdTipoCbteCble_MoviCaja_Egr);
                uccaj_tipo_movi_ingreso.set_MovimientoInfo(ParamCaja_I.IdTipo_movi_ing_x_reposicion);
            }
            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());
            }
        }
Beispiel #11
0
 public bool guardarDB(caj_parametro_Info info)
 {
     try
     {
         using (Entities_caja Context = new Entities_caja())
         {
             caj_parametro Entity = Context.caj_parametro.FirstOrDefault(q => q.IdEmpresa == info.IdEmpresa);
             if (Entity == null)
             {
                 Entity = new caj_parametro
                 {
                     IdEmpresa = info.IdEmpresa,
                     IdTipoCbteCble_MoviCaja_Egr  = info.IdTipoCbteCble_MoviCaja_Egr,
                     IdTipoCbteCble_MoviCaja_Ing  = info.IdTipoCbteCble_MoviCaja_Ing,
                     IdTipo_movi_ing_x_reposicion = info.IdTipo_movi_ing_x_reposicion,
                     DiasTransaccionesAPasado     = info.DiasTransaccionesAPasado,
                     DiasTransaccionesAFuturo     = info.DiasTransaccionesAFuturo,
                     IdUsuario     = info.IdUsuario,
                     Fecha_Transac = DateTime.Now
                 };
                 Context.caj_parametro.Add(Entity);
             }
             else
             {
                 Entity.IdTipoCbteCble_MoviCaja_Egr  = info.IdTipoCbteCble_MoviCaja_Egr;
                 Entity.IdTipoCbteCble_MoviCaja_Ing  = info.IdTipoCbteCble_MoviCaja_Ing;
                 Entity.IdTipo_movi_ing_x_reposicion = info.IdTipo_movi_ing_x_reposicion;
                 Entity.DiasTransaccionesAPasado     = info.DiasTransaccionesAPasado;
                 Entity.DiasTransaccionesAFuturo     = info.DiasTransaccionesAFuturo;
                 Entity.IdUsuarioUltMod = info.IdUsuarioUltMod;
                 Entity.FechaUltMod     = info.FechaUltMod;
             }
             Context.SaveChanges();
         }
         return(true);
     }
     catch (Exception)
     {
         throw;
     }
 }