private void BtnAdd_OnClick(object sender, RoutedEventArgs e)
        {
            var parent    = Parent as StackPanel;
            var labelElem = parent.TryFindParent <AssignmentCriterialElement>();

            if (labelElem != null)
            {
                var id        = labelElem.Model.Id;
                var isChecked = labelElem.Model.ChbPlatformChecked;
                var fieldName = CommonConstants.EndpointPlatform;
                var type      = CriteriaType.String;
                var lboc      = new AssignmentOperatorCriteria();
                lboc.Operator = ConstantHelper.IsOperator;
                lboc.Value1   = "86";
                lboc.Value2   = string.Empty;
                var lc = new AssignmentRuleCriteriaEnt
                {
                    Id               = id,
                    FieldName        = fieldName,
                    Type             = (byte)type,
                    IsAvailable      = isChecked,
                    Operator         = lboc.Operator,
                    Value1           = lboc.Value1,
                    Value2           = lboc.Value2,
                    AssignmentRuleId = id
                };

                var addbackgrount = new BackgroundWorker();
                addbackgrount.DoWork             += Addbackgrount_DoWork;
                addbackgrount.RunWorkerCompleted += Addbackgrount_RunWorkerCompleted;
                addbackgrount.RunWorkerAsync(lc);
            }
        }
Esempio n. 2
0
        public static int AddDirectoryAssignmentRuleCriteria(AssignmentRuleCriteriaEnt lc)
        {
            var resultDeserialize = ServiceManager.Invoke(sc => RequestResponseUtils.GetData <DataResponse>(
                                                              sc.AddAssignmentRuleCriteria,
                                                              lc));

            return(resultDeserialize.Result);
        }