コード例 #1
0
 public ActionResult Nuevo(int IdEmpresa = 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
     fa_cliente_Info model = new fa_cliente_Info
     {
         IdEmpresa            = IdEmpresa,
         IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSession),
         Idtipo_cliente       = 1,
         info_persona         = new Info.General.tb_persona_Info
         {
             pe_Naturaleza   = "NATU",
             IdTipoDocumento = "CED"
         },
         lst_fa_cliente_contactos = new List <fa_cliente_contactos_Info>(),
         Lst_fa_cliente_x_fa_Vendedor_x_sucursal = new List <fa_cliente_x_fa_Vendedor_x_sucursal_Info>()
     };
     List_fa_cliente_contactos.set_list(model.lst_fa_cliente_contactos, model.IdTransaccionSession);
     List_fa_cliente_x_fa_Vendedor_x_sucursal.set_list(model.Lst_fa_cliente_x_fa_Vendedor_x_sucursal, model.IdTransaccionSession);
     cargar_combos(model);
     cargar_combos_det();
     return(View(model));
 }
コード例 #2
0
        public ActionResult Anular(int IdEmpresa = 0, decimal IdCliente = 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, "Facturacion", "Cliente", "Index");
            if (!info.Anular)
            {
                return(RedirectToAction("Index"));
            }
            #endregion

            fa_cliente_Info model = bus_cliente.get_info(IdEmpresa, IdCliente);
            if (model == null)
            {
                return(RedirectToAction("Index"));
            }
            model.lst_fa_cliente_contactos = bus_cliente_contacto.get_list(IdEmpresa, IdCliente);
            List_fa_cliente_contactos.set_list(model.lst_fa_cliente_contactos, model.IdTransaccionSession);
            model.IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSession);
            model.Lst_fa_cliente_x_fa_Vendedor_x_sucursal = bus_fa_vendedor.get_list(IdEmpresa, IdCliente);
            List_fa_cliente_x_fa_Vendedor_x_sucursal.set_list(model.Lst_fa_cliente_x_fa_Vendedor_x_sucursal, model.IdTransaccionSession);
            cargar_combos(model);
            return(View(model));
        }