private static void UpdateTypeInterval(ServiceReference1.MainClient a, ServiceReference2.StaticClient b, User usr)
        {
            var cat = b.GetAllCategories(usr.UserId);
            var typeIntervals = b.GetAllTypeIntervals(usr.UserId);
            var recurrenceRules = b.GetAllRecurrenceRules();
            var typeTransactions = b.GetAllTypeTransactions(usr.UserId);

            // UPDATE //
            typeIntervals[0].Amount = 19d;
            typeIntervals[0].TransactionType = typeTransactions[1];
            typeIntervals[0].RecurrenceRuleValue.RulePartValueList[0].Value = "9123";
            typeIntervals[0].ModifiedDate = DateTime.Now;
            //staticData.TypeIntervals[1].ModifiedDate = DateTime.Now;

            typeIntervals[0].RecurrenceRangeRuleValue.RecurrenceRule = recurrenceRules.FirstOrDefault(x => x.Name == Const.Rule.RuleRangeTotalOcurrences.ToString());
            typeIntervals[0].RecurrenceRangeRuleValue.RulePartValueList[0].Value = "20100202";
            typeIntervals[0].RecurrenceRangeRuleValue.RulePartValueList[1].Value = "3";
            //staticData.TypeIntervals[0].RecurrenceRangeRuleValue.RulePartValueList[1].Value = "b22";
            //staticData.TypeIntervals[0].RecurrenceRangeRuleValue.RulePartValueList[1].Value = "c22";

            var k = new List<TypeInterval>();
            k.Add(typeIntervals[0]);

            var update = b.SaveTypeIntervals(k);

        }
        private static void InsertTypeInterval(ServiceReference1.MainClient a,ServiceReference2.StaticClient b, User usr)
        {
            var cat = b.GetAllCategories(usr.UserId);
            var typeTransReason = b.GetAllTypeTransactionReasons(usr.UserId);
            var typeIntervals = b.GetAllTypeIntervals(usr.UserId);
            var recurrenceRules = b.GetAllRecurrenceRules();
            var typeTransactions = b.GetAllTypeTransactions(usr.UserId);

            var catList = new CategoryList();
            cat.ForEach(x => catList.Add(x));

            var typeTransReasonList = new TypeTransactionReasonList();
            typeTransReason.ForEach(x => typeTransReasonList.Add(x));

            var typeTransactionsList = new TypeTransactionList();
            typeTransactions.ForEach(x => typeTransactionsList.Add(x));


            // INSERT //
            var intervals = new TypeIntervalList { new TypeInterval(catList, typeTransReasonList, typeTransactionsList, usr) };
            //intervals[0].RecurrenceRule = staticData.RecurrenceRules.FirstOrDefault(x => x.Name == "RuleDailyEveryDays");


            var found = recurrenceRules.FirstOrDefault(x => x.Name == "RuleDailyEveryDays");
            intervals[0].RecurrenceRuleValue.RecurrenceRule = found;
            intervals[0].RecurrenceRuleValue.RulePartValueList[0].Value = "aaa";
            intervals[0].RecurrenceRuleValue.RulePartValueList[1].Value = "bbb";

            intervals[0].RecurrenceRangeRuleValue.RecurrenceRule = recurrenceRules.FirstOrDefault(x => x.Name == Const.Rule.RuleRangeTotalOcurrences.ToString());
            intervals[0].RecurrenceRangeRuleValue.RulePartValueList[0].Value = "20111111";
            intervals[0].RecurrenceRangeRuleValue.RulePartValueList[1].Value = "234";


            var result = b.SaveTypeIntervals(intervals.ToList());

        }
        private static void DeleteTypeInterval(ServiceReference2.StaticClient b, User usr)
        {
            var typeIntervals = b.GetAllTypeIntervals(usr.UserId);

            var interval1 = typeIntervals[0];
            interval1.IsDeleted = true;
            interval1.ModifiedDate = DateTime.Now;

            var interval2 = typeIntervals[1];
            interval2.IsDeleted = true;
            interval2.ModifiedDate = DateTime.Now;

            var interval3 = typeIntervals[2];
            interval3.IsDeleted = true;
            interval3.ModifiedDate = DateTime.Now;

            var k = new List<TypeInterval> { interval1, interval2, interval3 };
            
            var update = b.SaveTypeIntervals(k);
        }