public override Item Clone()
 {
     return(new ExceptItem()
     {
         Except = Except?.Clone(),
     });
 }
コード例 #2
0
 public DataCube(string name, DataStatement statement, string assignTo)
 {
     NaDrop             = new NaDrop();
     ReplaceNull        = new NullReplace();
     ReplaceString      = new StringReplace();
     this.StatementType = statement;
     SchemaName         = "";
     VariableName       = name;
     AssignTo           = assignTo;
     Distrinct          = false;
     SelectStatement    = new Select();
     GroupByStatement   = new GroupBy();
     CubeStatement      = new Cube();
     ExceptStatement    = new Except();
     IntersectStatement = new Intersect();
     DropStatement      = new Drop();
     JoinStatement      = new List <Join>();
     RollupStatement    = new Rollup();
     SearchStatement    = new Search();
     SortStatement      = new SortBy();
     LimitStatement     = new Limit();
     LoadStatement      = new Load();
     Fields             = new List <IField>();
     Drop           = false;
     UnionStatement = new Union();
     Declaration    = new Declaration();
     DataWith       = new With();
 }
コード例 #3
0
        public static void RegisterProvider(FilterProviderCollection providerCollection)
        {
            var filterProvider = FluentMvcConfiguration
                                 .ConfigureFilterProvider(x =>
            {
                x.WithResultFactory <ActionResultFactory>()
                .WithResultFactory <JsonResultFactory>()
                .WithResultFactory <ViewResultFactory>(isDefault: true);

                x.WithResultFactory <ErrorThrowingResultFactory>(
                    Apply.For <HomeController>(hc => hc.ErrorResultFactory()));

                x.WithFilter <HandleErrorAttribute>();
                x.WithFilter <AuthorizeAttribute>(
                    Except
                    .For <AccountController>(ac => ac.LogOn())
                    .AndFor <AccountController>(
                        ac => ac.LogOn(null, null, false, null))
                    .AndFor <HomeController>());

                x.WithFilter <ErrorThrowingFilter>(
                    Apply.When <ExpectsHtml>().For <HomeController>(hc => hc.About()));
            });

            providerCollection.Insert(0, filterProvider);
        }
コード例 #4
0
 private void btnConfirm_Click(object sender, RoutedEventArgs e)
 {
     try {
         // Prepares new entity to travel to service
         Entidades.Asunto newAsunto = new Entidades.Asunto()
         {
             Numero                = txtAsuntoNumber.Text,
             DescripcionBreve      = txtShortDescription.Text,
             Oper                  = operatorToSent,
             isCreatedByBackoffice = true
         };
         // Generates a new logic asunto object
         Logica.Asunto logAsunto = new Logica.Asunto();
         // Gets operator logged on application
         Entidades.Operador backofficeOperator = App.Current.Properties["user"] as Entidades.Operador;
         // Calls a sent method
         logAsunto.SentAsuntoToOperator(backofficeOperator, newAsunto);
         // Set property on public property
         confirmedNewAsunto = newAsunto;
         // Sets result to true
         DialogResult = true;
     }
     catch (Exception ex) {
         Except.Throw(ex);
     }
 }
 public override v2_0.Item Upgrade()
 {
     return(new v2_0.ExceptItem()
     {
         Except = Except?.Upgrade(),
     });
 }
コード例 #6
0
 /// <summary>
 /// Process a request from the service for new asunto
 /// </summary>
 /// <param name="a"></param>
 private void newAsuntoFromService(Asunto a)
 {
     try {
         // Generamos un objeto de logica para procesar el agregado de los asuntos
         Logica.Asunto logAsunto = new Logica.Asunto();
         // Gestionamos una variable operador disponible para el método
         Operador operLogged = App.Current.Properties["user"] as Operador;
         // Si el operador al que era destino de este asunto no es el logueado, se lanza una excepción
         if (a.Oper.UserName != operLogged.UserName)
         {
             throw new Exception("Se ha recibido un asunto de un operador erroneo. Informar al administrador. Asunto: " + a.Numero + ". Operador: " + a.Oper.UserName);
         }
         // TODO : A modo de prueba inicial, el primer estado lo generamos en la capa de presentación. Esto debería ser generado en el servicio, para mantener fidelidad con el horario de entrada del asunto en bandeja
         generateInitialStatusOfAsunto(a);
         // Consultamos si el asunto en cuestion existe en la base de datos del operador
         if (!logAsunto.Exist(a))
         {
             // Si no existe, se agrega a la base de datos
             logAsunto.Add(a);
             // Actualizamos la capa de presentación y los casos diarios
             NotifyUIOfNewAsunto(a.Numero, false);
         }
     }
     catch (Exception ex) {
         Except.Throw(ex);
     }
 }
コード例 #7
0
 /// <summary>
 /// Set up error service adding to the interface the current instance
 /// </summary>
 private void configureErrorService()
 {
     // Set up Exception Interface
     Except.LoadInterface(this);
     // Set up Assertion Interface
     Assert.LoadInterface(this);
 }
コード例 #8
0
        private async void btnLoadBatchAsuntos_Click(object sender, RoutedEventArgs e)
        {
            try {
                List <Entidades.Asunto> lstToDistribute;
                if (!bllSelectedOnly)
                {
                    CheckLoadedUsersInAsunto();
                    lstToDistribute = lstAsuntoToAssign.ToList();
                }
                else
                {
                    isOneOperatorLoaded();
                    lstToDistribute = lstAsuntoToAssign.Where(asunto => asunto.Oper != null).ToList();
                }
                // Set sending time to current
                DateTime dtSendingTime = DateTime.Now;
                // On all filtered asuntos save sending date
                lstToDistribute.ForEach(asunto => asunto.SendingDate = dtSendingTime);
                // Generate a new logic asunto object
                Logica.Asunto      logAsunto      = new Logica.Asunto();
                Entidades.Operador currBackOffice = App.Current.Properties["user"] as Entidades.Operador;
                // Call for asunto distribution in batch
                await logAsunto.SentBatchAsuntoToOperators(currBackOffice, lstToDistribute);

                // Update balance with asuntos sented
                lstToDistribute.ForEach(asuntoToDeliver => currentBalanceFromOperators.Increment(asuntoToDeliver));
                currentBalanceFromOperators.UpdateAverage();
                // Refresh report of caller method
                (Owner as frmBackoffice).RefreshReportBalanceCurrentDay();
                Util.MsgBox.Error("Completado correctamente");
            }
            catch (Exception ex) {
                Except.Throw(ex);
            }
        }
コード例 #9
0
 private void newAsuntoFromService(List <Asunto> lstOfNewAsuntos)
 {
     try {
         // Get current user properties and save in a temporary variable
         Operador operatorCurrentlyLogeed = App.Current.Properties["user"] as Operador;
         // Compare all asuntos with operator to confirm if all are the same
         if (!lstOfNewAsuntos.TrueForAll(asunto => asunto.Oper.UserName == operatorCurrentlyLogeed.UserName))
         {
             string[] lstOfAsuntosCorrupted = lstOfNewAsuntos.FindAll(asunto => asunto.Oper.UserName != asunto.Oper.UserName).Select(asunto => asunto.Numero).ToArray();
             throw new Exception("Se ha encontrado que los siguientes asuntos no estaban destinados a vos: " + string.Join(", ", lstOfAsuntosCorrupted) + ". Informe al administrador");
         }
         // On all asuntos generate starting status
         lstOfNewAsuntos.ForEach(asunto => generateInitialStatusOfAsunto(asunto));
         // Generate new logic asunto object
         Logica.Asunto logAsunto = new Logica.Asunto();
         // Save list of non duplicated asuntos in a new list
         List <Asunto> lstNonDuplicatedAsuntos = logAsunto.GetNonDuplicatedAsuntosFromList(lstOfNewAsuntos);
         // Select from the list only the asuntos non duplicated
         if (lstNonDuplicatedAsuntos.Count > 0)
         {
             // Procedd with add al filtered asuntos
             logAsunto.Add(lstNonDuplicatedAsuntos);
             // Show on UI layer reporting new asunto count
             NotifyUIOfNewAsunto(lstNonDuplicatedAsuntos.Count.ToString(), true);
         }
     } catch (Exception ex) {
         Except.Throw(ex);
     }
 }
コード例 #10
0
 private void LoadExceptionInterface()
 {
     // Serve interface for Exception Process
     Except.LoadInterface(this);
     // Serve interface for Assertion Process
     Assert.LoadInterface(this);
 }
コード例 #11
0
        public void should_create_not_constraint()
        {
            var whenDsl = Except.When <CustomContraint>();

            whenDsl.ConstraintRegistrations.Length.ShouldBeGreaterThan(0);
            whenDsl.ConstraintRegistrations[0].Prepare(new FluentMvcObjectFactory());
            whenDsl.ConstraintRegistrations[0].Constraint.ShouldBeOfType(typeof(NotConstraint));
        }
コード例 #12
0
 /// <summary>
 /// Process a request to sent asunto to the service for distribution
 /// </summary>
 /// <param name="prmBackofficeSender">Backoffice who calls sent</param>
 /// <param name="prmAsuntoToSent">Asunto to sent</param>
 public async void SentAsuntoToOperator(Entidades.Operador prmBackofficeSender, Entidades.Asunto prmAsuntoToSent)
 {
     try {
         await datAsunto.SentAsuntoToOperator(prmBackofficeSender, prmAsuntoToSent);
     }
     catch (Exception ex) {
         Except.Throw(ex);
     }
 }
コード例 #13
0
 /// <summary>
 /// Sent a client of the service a petition to add in queue al asunto
 /// </summary>
 /// <param name="prmBackofficeSender"></param>
 /// <param name="prmAsuntoToSent"></param>
 public async Task SentAsuntoToOperator(Entidades.Operador prmBackofficeSender, Entidades.Asunto prmAsuntoToSent)
 {
     try {
         await Client.Instance.SentAsuntoToOperator(prmBackofficeSender, prmAsuntoToSent);
     }
     catch (Exception ex) {
         Except.Throw(ex);
     }
 }
コード例 #14
0
ファイル: IW4MServer.cs プロジェクト: mldYM/IW4M-Admin
        public override async Task ExecuteEvent(GameEvent E)
        {
            bool canExecuteCommand = true;

            if (!await ProcessEvent(E))
            {
                return;
            }

            Command C = null;

            if (E.Type == GameEvent.EventType.Command)
            {
                try
                {
                    C = await SharedLibraryCore.Commands.CommandProcessing.ValidateCommand(E);
                }

                catch (CommandException e)
                {
                    Logger.WriteInfo(e.Message);
                }

                if (C != null)
                {
                    E.Extra = C;
                }
            }

            foreach (var plugin in SharedLibraryCore.Plugins.PluginImporter.ActivePlugins)
            {
                try
                {
                    await plugin.OnEventAsync(E, this);
                }
                catch (AuthorizationException e)
                {
                    E.Origin.Tell($"{loc["COMMAND_NOTAUTHORIZED"]} - {e.Message}");
                    canExecuteCommand = false;
                }
                catch (Exception Except)
                {
                    Logger.WriteError($"{loc["SERVER_PLUGIN_ERROR"]} [{plugin.Name}]");
                    Logger.WriteDebug(Except.GetExceptionInfo());
                }
            }

            // hack: this prevents commands from getting executing that 'shouldn't' be
            if (E.Type == GameEvent.EventType.Command &&
                E.Extra != null &&
                (canExecuteCommand ||
                 E.Origin?.Level == EFClient.Permission.Console))
            {
                await(((Command)E.Extra).ExecuteAsync(E));
            }
        }
コード例 #15
0
 public static IEnumerable <ChatClient> GetClientsExcept(params ChatClient[] Except)
 {
     foreach (var C in Clients)
     {
         if (!Except.Contains(C))
         {
             yield return(C);
         }
     }
 }
コード例 #16
0
        public override void Given()
        {
            Expression <Func <TestController, object> >       func  = c => c.ReturnPost();
            Expression <Func <SecondTestController, object> > func2 = c => c.ReturnPost();

            actionDescriptor        = func.CreateActionDescriptor();
            anotherActionDescriptor = func2.CreateActionDescriptor();
            actionFilterRegistry    = new ActionFilterRegistry(CreateStub <IFluentMvcObjectFactory>());
            Configuration           = FluentMvcConfiguration.Create(CreateStub <IFluentMvcResolver>(), actionFilterRegistry, CreateStub <IActionResultRegistry>(), CreateStub <IFilterConventionCollection>())
                                      .WithFilter <TestActionFilter>(Except.For <TestController>());
        }
コード例 #17
0
 /// <summary>
 /// Sent to the service an asunto to deliver
 /// </summary>
 /// <param name="prmBackofficeSender">Backoffice who sends asunto</param>
 /// <param name="prmAsuntoToSent">Asunto to send</param>
 public async Task SentAsuntoToOperator(Entidades.Operador prmBackofficeSender, Entidades.Asunto prmAsuntoToSent)
 {
     try {
         // Manage status of the proxy
         await HandleProxy();
         proxy.SentAsuntoToOperator(prmBackofficeSender, prmAsuntoToSent);
     }
     catch (Exception ex) {
         Except.Throw(ex);
     }
 }
コード例 #18
0
 static void Main(string[] args)
 {
     try
     {
         Except.ThrowMsg("C is fun");
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
     }
 }
コード例 #19
0
 public IEnumerator <int> GetEnumerator()
 {
     _enumeratorInitialized = true;
     for (int i = _start; i <= _finish; i += Step)
     {
         if (!Except.Contains(i))
         {
             yield return(i);
         }
     }
 }
コード例 #20
0
 static void Main(string[] args)
 {
     try
     {
         Except.Throw();
     }
     catch (Exception)
     {
         Console.WriteLine("Exception raised");
     }
 }
コード例 #21
0
ファイル: Subject.cs プロジェクト: CoolWirya/BS
 public System.Data.DataTable GetSubjectList()
 {
     try
     {
         return(GetSubjectList(0));
     }
     catch (Exception ex)
     {
         Except.AddException(ex);
         return(null);
     }
 }
コード例 #22
0
 async void IServicioCallback.EnviarAsunto(Entidades.Asunto a)
 {
     try {
         // Duplicates entity for confirmation
         Entidades.Asunto entNewAsunto = new Entidades.Asunto(a);
         callbackInteraction.EnviarAsunto(entNewAsunto);
         await prepareProxy();
         proxy.AsuntoReceiptCompleted(a);
     }
     catch (Exception ex) {
         Except.Throw(ex);
     }            
 }
コード例 #23
0
        public override void Given()
        {
            actionFilterRegistry = new ActionFilterRegistry(CreateStub <IFluentMvcObjectFactory>());
            Expression <Func <TestController, object> > func      = controller => controller.ReturnPost();
            Expression <Func <TestController, object> > otherFunc = controller => controller.ReturnViewResult();

            actionDescriptor          = func.CreateActionDescriptor();
            incorrectActionDescriptor = otherFunc.CreateActionDescriptor();
            Configuration             = FluentMvcConfiguration.Create(CreateStub <IFluentMvcResolver>(), actionFilterRegistry, CreateStub <IActionResultRegistry>(), CreateStub <IFilterConventionCollection>())
                                        .WithFilter <TestActionFilter>(Except.For <SecondTestController>().AndFor <TestController>(func).AndFor <TestController>(t => t.ReturnNull()));

            registryTester = new ActionFilterRegistryTester(actionFilterRegistry);
        }
コード例 #24
0
ファイル: WorkFlow.cs プロジェクト: CoolWirya/BS
 private void SetWorkFlowCondition()
 {
     try
     {
         DataColumn DC = new DataColumn("WorkFlowCondition");
         DC.Expression = ClassLibrary.JGeneral.ConvertToPersian(Condition);
         _PublicDataRow.Columns.Add(DC);
     }
     catch (Exception ex)
     {
         Except.AddException(ex);
     }
 }
コード例 #25
0
 private void chkAutomaticAssignment_Checked(object sender, RoutedEventArgs e)
 {
     try {
         // Nullfies itemsource of datagrid
         dgAsuntosWithoutAssignation.ItemsSource = null;
         // Process simulation of automatic assignment
         currentBalanceFromOperators.GetAutomaticAsuntoAssignationByAverageHour(lstAsuntoToAssign.ToList(), lstOperatorForAssign.Select(oad => oad.Operator).Where(oper => oper != null).ToList());
         // Refresh list
         dgAsuntosWithoutAssignation.ItemsSource = lstAsuntoToAssign;
     } catch (Exception ex) {
         Except.Throw(ex);
     }
 }
コード例 #26
0
 public async void BatchAsuntoProcessCompleted(List <Asunto> lstA)
 {
     try {
         lstA.ForEach(asunto => balanceOfOperators.Increment(asunto));
         balanceOfOperators.UpdateAverage();
     } catch (Exception ex) {
         Except.Throw(ex);
     }
     await Dispatcher.BeginInvoke((Action)(() =>
     {
         getAsuntosWithoutAssignation();
         LoadReportInformation();
     }));
 }
        public override IEnumerable <DVD> Filter(IEnumerable <DVD> profiles)
        {
            if (Except != null)
            {
                var filtered = Except.Filter(profiles);

                var result = profiles.Except(filtered);

                return(result);
            }
            else
            {
                return(profiles);
            }
        }
コード例 #28
0
 public CartController(ICartDomain CartDomain, IUow Uow)
 {
     try
     {
         this.Uow        = Uow;
         this.CartDomain = CartDomain;
         Console.WriteLine("hi");
     }
     catch (Exception ex)
     {
         Except exception = new Except();
         exception.Message = ex.Message;
         Uow.Repository <Except>().Add(exception);
     }
 }
コード例 #29
0
 /// <summary>
 ///		Comprueba si el nombre de tabla está entre las excepciones
 /// </summary>
 private bool CheckIsAtException(string table)
 {
     // Comprueba si está en la lista de excepciones
     if (!string.IsNullOrWhiteSpace(Except))
     {
         foreach (string exception in Except.Split(','))
         {
             if (table.Equals(exception, StringComparison.CurrentCultureIgnoreCase))
             {
                 return(true);
             }
         }
     }
     // Devuelve el valor que indica si está en la lista de excepciones
     return(false);
 }
コード例 #30
0
        public int GetColumnsWidth(params ColumnSize[] Except)
        {
            int Width = 0;

            var Columns = new[]
            {
                BannerColumnSize, DiscIdColumnSize, TitleColumnSize, FirmwareColumnSize, RegionColumnSize,
                PathColumnSize
            };

            foreach (var Column in Columns)
            {
                if (!Except.Contains(Column))
                {
                    Width += Column.Width;
                }
            }
            return(Width);
        }
コード例 #31
0
ファイル: Row.cs プロジェクト: GunioRobot/Eat-My-Snake
 public Row()
 {
     this.Content = Content.Empty;
     this.except = Except.No;
     this.andOrState = AndOrState.AndGrey;
 }
コード例 #32
0
ファイル: Row.cs プロジェクト: GunioRobot/Eat-My-Snake
 public Row(Content content)
 {
     this.Content = content;
     this.except = Except.No;
     this.andOrState = AndOrState.AndGrey;
 }
コード例 #33
0
ファイル: Row.cs プロジェクト: GunioRobot/Eat-My-Snake
 public Row(Content content, Except except, AndOrState andOrState)
 {
     this.Content = content;
     this.except = except;
     this.andOrState = andOrState;
 }
コード例 #34
0
    static void Main() 
    {
      if (default_args.anonymous() != 7771)
        throw new Exception("anonymous (1) failed");
      if (default_args.anonymous(1234) != 1234)
        throw new Exception("anonymous (2) failed");

      if (default_args.booltest() != true)
        throw new Exception("booltest (1) failed");
      if (default_args.booltest(true) != true)
        throw new Exception("booltest (2) failed");
      if (default_args.booltest(false) != false)
        throw new Exception("booltest (3) failed");

      EnumClass ec = new EnumClass();
      if (ec.blah() != true)
        throw new Exception("EnumClass failed");

      if (default_args.casts1() != null)
        throw new Exception("casts1 failed");

      if (default_args.casts2() != "Hello")
        throw new Exception("casts2 failed");

      if (default_args.casts1("Ciao") != "Ciao")
        throw new Exception("casts1 not default failed");

      if (default_args.chartest1() != 'x')
        throw new Exception("chartest1 failed");

      if (default_args.chartest2() != '\0')
        throw new Exception("chartest2 failed");

      if (default_args.chartest1('y') != 'y')
        throw new Exception("chartest1 not default failed");

      if (default_args.chartest1('y') != 'y')
        throw new Exception("chartest1 not default failed");

      if (default_args.reftest1() != 42)
        throw new Exception("reftest1 failed");

      if (default_args.reftest1(400) != 400)
        throw new Exception("reftest1 not default failed");

      if (default_args.reftest2() != "hello")
        throw new Exception("reftest2 failed");

      // rename
      Foo foo = new Foo();
      foo.newname(); 
      foo.newname(10); 
      foo.renamed3arg(10, 10.0); 
      foo.renamed2arg(10); 
      foo.renamed1arg(); 

      // exception specifications
      try {
        default_args.exceptionspec();
        throw new Exception("exceptionspec 1 failed");
      } catch (Exception) {
      }
      try {
        default_args.exceptionspec(-1);
        throw new Exception("exceptionspec 2 failed");
      } catch (Exception) {
      }
      try {
        default_args.exceptionspec(100);
        throw new Exception("exceptionspec 3 failed");
      } catch (Exception) {
      }
      Except ex = new Except(false);
      try {
        ex.exspec();
        throw new Exception("exspec 1 failed");
      } catch (Exception) {
      }
      try {
        ex.exspec(-1);
        throw new Exception("exspec 2 failed");
      } catch (Exception) {
      }
      try {
        ex.exspec(100);
        throw new Exception("exspec 3 failed");
      } catch (Exception) {
      }
      try {
        ex = new Except(true);
        throw new Exception("Except constructor 1 failed");
      } catch (Exception) {
      }
      try {
        ex = new Except(true, -2);
        throw new Exception("Except constructor 2 failed");
      } catch (Exception) {
      }

      // Default parameters in static class methods
      if (Statics.staticmethod() != 10+20+30)
        throw new Exception("staticmethod 1 failed");
      if (Statics.staticmethod(100) != 100+20+30)
        throw new Exception("staticmethod 2 failed");
      if (Statics.staticmethod(100,200,300) != 100+200+300)
        throw new Exception("staticmethod 3 failed");


      Tricky tricky = new Tricky();
      if (tricky.privatedefault() != 200)
        throw new Exception("privatedefault failed");
      if (tricky.protectedint() != 2000)
        throw new Exception("protectedint failed");
      if (tricky.protecteddouble() != 987.654)
        throw new Exception("protecteddouble failed");
      if (tricky.functiondefault() != 500)
        throw new Exception("functiondefault failed");
      if (tricky.contrived() != 'X')
        throw new Exception("contrived failed");

      if (default_args.constructorcall().val != -1)
        throw new Exception("constructorcall test 1 failed");

      if (default_args.constructorcall(new Klass(2222)).val != 2222)
        throw new Exception("constructorcall test 2 failed");

      if (default_args.constructorcall(new Klass()).val != -1)
        throw new Exception("constructorcall test 3 failed");

      // const methods 
      ConstMethods cm = new ConstMethods();
      if (cm.coo() != 20)
        throw new Exception("coo test 1 failed");
      if (cm.coo(1.0) != 20)
        throw new Exception("coo test 2 failed");
    }