private void BtnAdd_OnClick(object sender, RoutedEventArgs e) { var parent = Parent as StackPanel; var labelElem = parent.TryFindParent <LabelCriteriaElement>(); if (labelElem != null) { var labelId = labelElem.Model.LabelId; var isChecked = labelElem.Model.ChbIPv4Checked; var fieldName = CommonConstants.EndpointIPv4; var type = CriteriaType.String; var lboc = new LabelOperatorCriteria(); lboc.Operator = ConstantHelper.IsBetweenOperator; lboc.Value1 = string.Empty; lboc.Value2 = string.Empty; var lc = new LabelCriteria { LabelId = labelId, FieldName = fieldName, Type = (byte)type, IsAvailable = isChecked, LabelOperatorCriterias = new List <LabelOperatorCriteria>() }; lc.LabelOperatorCriterias.Add(lboc); var addbackgrount = new BackgroundWorker(); addbackgrount.DoWork += Addbackgrount_DoWork; addbackgrount.RunWorkerCompleted += Addbackgrount_RunWorkerCompleted; addbackgrount.RunWorkerAsync(lc); } }
public static int AddLabelCriteria(LabelCriteria lc) { using (var sc = new POCServiceClient("NetTcpBinding_IPOCService")) { var datareq = EncryptionHelper.EncryptString(JsonConvert.SerializeObject(lc), Key); var rs = sc.AddLabelCriteria(datareq); ApplicationContext.IsRebuildTree = true; return(EncryptionHelper.DecryptStringToInt(rs, Key)); } }
public static LabelInfoList LabelFetchInfoList(LabelCriteria criteria) { return(LabelInfoList.FetchLabelInfoList(criteria)); }