Exemplo n.º 1
0
        public void TestExtendingTypeAtRunrimeAndAddOpenEngSBModelEntries()
        {
            Type   type        = HelpMethods.ImplementTypeDynamicly(typeof(Entry1), typeof(IOpenEngSBModel));
            Object entryObject = Activator.CreateInstance(type);
            Entry1 entry       = (Entry1)entryObject;

            entry.key   = "test";
            entry.value = 1;
            List <openEngSBModelEntry> elements = new List <openEngSBModelEntry>();
            openEngSBModelEntry        osbEntry = new openEngSBModelEntry();

            osbEntry.key   = "key";
            osbEntry.type  = "type";
            osbEntry.value = "value";
            elements.Add(osbEntry);

            IOpenEngSBModel entryOpenEngSB = (IOpenEngSBModel)entry;

            entryOpenEngSB.OpenEngSBModelTail = elements;

            String          objString         = marshaller.MarshallObject(entry);
            IOpenEngSBModel objUnmarshalled   = (IOpenEngSBModel)marshaller.UnmarshallObject(objString, type);
            Entry1          entryUnmarshalled = (Entry1)objUnmarshalled;

            Assert.IsTrue(objString.ToUpper().Contains("OPENENGSBMODELTAIL"));
            Assert.IsTrue(entryObject is Entry1);
            Assert.IsTrue(entryObject is IOpenEngSBModel);
            Assert.AreEqual(elements.Count, objUnmarshalled.OpenEngSBModelTail.Count);
            Assert.AreEqual(objUnmarshalled.OpenEngSBModelTail[0].key, osbEntry.key);
            Assert.AreEqual(objUnmarshalled.OpenEngSBModelTail[0].type, osbEntry.type);
            Assert.AreEqual(objUnmarshalled.OpenEngSBModelTail[0].value, osbEntry.value);
            Assert.AreEqual(entryUnmarshalled.key, entry.key);
            Assert.AreEqual(entryUnmarshalled.value, entry.value);
        }
        public MainPage()
        {
            InitializeComponent();

            Entry1.Completed += (sender, args) =>
            {
                Entry2.IsEnabled = true;
                if (string.IsNullOrEmpty(Entry2.Text))
                {
                    Entry2.Focus();
                }
            };

            Entry2.Completed += (sender, args) =>
            {
                Entry3.IsEnabled = true;
                if (string.IsNullOrEmpty(Entry3.Text))
                {
                    Entry3.Focus();
                }
            };

            Entry1.Unfocused += async(sender, args) =>
            {
                if (string.IsNullOrEmpty(Entry1.Text))
                {
                    await DisplayAlert("Atenção", "Digite a mensagem!", "Ok");

                    Entry1.Focus();
                }
                else
                {
                    Entry1.SendCompleted();
                }
            };

            Entry2.Unfocused += async(sender, args) =>
            {
                if (string.IsNullOrEmpty(Entry2.Text))
                {
                    await DisplayAlert("Atenção", "Digite a mensagem!", "Ok");

                    Entry2.Focus();
                }
                else
                {
                    Entry2.SendCompleted();
                }
            };

            Entry3.Unfocused += async(sender, args) =>
            {
                if (string.IsNullOrEmpty(Entry3.Text))
                {
                    await DisplayAlert("Atenção", "Digite a mensagem!", "Ok");

                    Entry3.Focus();
                }
            };
        }
Exemplo n.º 3
0
        public void ParseValueTest()
        {
            Entry1 entry = (Entry1)TypeConverter.ConvertValue("A,B", typeof(Entry1), XamlNamespaces.Empty);

            Assert.AreEqual("A", entry.Value1);
            Assert.AreEqual("B", entry.Value2);
        }
Exemplo n.º 4
0
        public Entry1 CompleteAndAdd(Entry1 it)
        {
            Entry1List.Add(it);

            it.BoundingBox = Enumerable.Range(
                it.Entry2Index,
                it.Entry2LastIndex - it.Entry2Index
                )
                             .Select(index => Entry2List[index].BoundingBox)
                             .Concat(SelectBoundingBoxList(it))
                             .MergeAll();

            return(it);
        }
Exemplo n.º 5
0
        private async void ButtonFacebook_Clicked(object sender, System.EventArgs e)
        {
            await Task.WhenAny(Label1.FadeTo(0, AnimationSpeed, Easing.SinIn), Task.Delay(80));

            await Task.WhenAny(Entry1.FadeTo(0, AnimationSpeed, Easing.SinIn), Task.Delay(80));

            await Task.WhenAny(Label2.FadeTo(0, AnimationSpeed, Easing.SinIn), Task.Delay(80));

            await Task.WhenAny(Entry2.FadeTo(0, AnimationSpeed, Easing.SinIn), Task.Delay(80));

            await Task.WhenAny(buttonSubmit.FadeTo(0, AnimationSpeed, Easing.SinIn), Task.Delay(80));

            await buttonFacebook.FadeTo(0, AnimationSpeed, Easing.SinIn);
        }
Exemplo n.º 6
0
        private IEnumerable <SetEligibilityRequest> SetEligibilityRequestPaging(int?page)
        {
            if (page == null)
            {
                ViewBag.DateSortParm = SortOrder1 == "Date" ? "Date_desc" : "Date";
                ViewBag.EligSortParm = SortOrder1 == "Elig" ? "Elig_desc" : "Elig";
                ViewBag.DatetimeProcessedSortParm = SortOrder1 == "DatetimeProcessed" ? "DatetimeProcessed_desc" : "DatetimeProcessed";
                ViewBag.StatusSortParm            = SortOrder1 == "Status" ? "Status_desc" : "Status";
            }

            switch (SortOrder1)
            {
            case "Date":
                Entry1 = Entry1.OrderBy(s => s.EligDate);
                break;

            case "Elig_desc":
                Entry1 = Entry1.OrderByDescending(s => s.Elig);
                break;

            case "Elig":
                Entry1 = Entry1.OrderBy(s => s.Elig);
                break;

            case "DatetimeProcessed_desc":
                Entry1 = Entry1.OrderByDescending(s => s.DatetimeProcessed);
                break;

            case "DatetimeProcessed":
                Entry1 = Entry1.OrderBy(s => s.DatetimeProcessed);
                break;

            case "Status_desc":
                Entry1 = Entry1.OrderByDescending(s => s.Status);
                break;

            case "Status":
                Entry1 = Entry1.OrderBy(s => s.Status);
                break;

            default:
                Entry1 = Entry1.OrderByDescending(s => s.EligDate);
                break;
            }

            ViewBag.CurrentSort1 = SortOrder1;
            return(Entry1);
        }
Exemplo n.º 7
0
        public void TestIfMapIsRecognizedAndIfVariablesAreDetectedCorrectlyAndCorrectConvertedFromJsonToObject()
        {
            IDictionary result = new Dictionary <String, String>();

            Entry1[] entry = new Entry1[]
            {
                new Entry1()
                {
                    key = "Test", value = 123
                }
            };
            result.Add("123", new JsonMarshaller().MarshallObject(entry));
            EntryWithEntryParameter[] arrays = (EntryWithEntryParameter[])result.ConvertMap(typeof(EntryWithEntryParameter));
            Assert.IsTrue(arrays[0].key.Equals("123"));
            Assert.IsTrue(arrays[0].value[0].key.Equals("Test"));
        }
Exemplo n.º 8
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();

            await Task.WhenAny(Label1.ScaleTo(1, AnimationSpeed, Easing.SinIn), Task.Delay(80));

            await Task.WhenAny(Entry1.ScaleTo(1, AnimationSpeed, Easing.SinIn), Task.Delay(80));

            await Task.WhenAny(Label2.ScaleTo(1, AnimationSpeed, Easing.SinIn), Task.Delay(80));

            await Task.WhenAny(Entry2.ScaleTo(1, AnimationSpeed, Easing.SinIn), Task.Delay(80));

            await Task.WhenAny(buttonSubmit.ScaleTo(1, AnimationSpeed, Easing.SinIn), Task.Delay(80));

            await buttonFacebook.ScaleTo(1, AnimationSpeed, Easing.SinIn);
        }
Exemplo n.º 9
0
        private IEnumerable <BoundingBox> SelectBoundingBoxList(Entry1 ent1)
        {
            if (ent1.Child1 != -1)
            {
                yield return(Entry1List[ent1.Child1].BoundingBox);

                if (ent1.Child2 != -1)
                {
                    yield return(Entry1List[ent1.Child2].BoundingBox);

                    if (ent1.Child3 != -1)
                    {
                        yield return(Entry1List[ent1.Child3].BoundingBox);

                        if (ent1.Child4 != -1)
                        {
                            yield return(Entry1List[ent1.Child4].BoundingBox);

                            if (ent1.Child5 != -1)
                            {
                                yield return(Entry1List[ent1.Child5].BoundingBox);

                                if (ent1.Child6 != -1)
                                {
                                    yield return(Entry1List[ent1.Child6].BoundingBox);

                                    if (ent1.Child7 != -1)
                                    {
                                        yield return(Entry1List[ent1.Child7].BoundingBox);

                                        if (ent1.Child8 != -1)
                                        {
                                            yield return(Entry1List[ent1.Child8].BoundingBox);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 10
0
        public void TestConvertDictionaryToEntry1WithParameterTypeAreEntry1AndInJsonFormat()
        {
            // This Test case checks if an object that is not an array is not recognized as Map and converted correctly
            IDictionary result   = new Dictionary <String, String>();
            Entry1      keyEntry = new Entry1 {
                key = "Test", value = 123
            };
            Entry1 valueEntry = new Entry1 {
                key = "ValueTest", value = 111
            };

            result.Add(marshaller.MarshallObject(keyEntry), marshaller.MarshallObject(valueEntry));

            EntryWithAllEntryParameter[] arrays = (EntryWithAllEntryParameter[])result.ConvertMap(typeof(EntryWithAllEntryParameter));

            Assert.AreEqual <String>(arrays[0].key.key, keyEntry.key);
            Assert.AreEqual <int>(arrays[0].key.value, keyEntry.value);
            Assert.AreEqual <String>(arrays[0].value.key, valueEntry.key);
            Assert.AreEqual <int>(arrays[0].value.value, valueEntry.value);
        }
Exemplo n.º 11
0
        private void setViewBags()
        {
            if (!String.IsNullOrEmpty(InstitutionID))
            {
                ViewBag.Program = PROGRAM_ID.UPASS; // ni.ProgramId;
                var ni = Logs.GetNCSInfo(InstitutionID);
                if (ni != null)
                {
                    ViewBag.Name           = ni.Name;
                    ViewBag.OrganizationId = ni.OrganizationId;
                    ViewBag.ShortName      = ni.ShortName;
                }
            }
            ViewBag.InstitutionID = InstitutionID;
            ViewBag.GUID          = GUID;

            ViewBag.SetEligibilityRequest = Entry1.ToPagedList(Page1, pageSize);
            ViewBag.SetCardRequest        = Entry2.ToPagedList(Page2, pageSize);
            ViewBag.SetBenefitRequest     = Entry3.ToPagedList(Page3, pageSize);
        }
Exemplo n.º 12
0
        public ActionResult Index(string institutionID, string guid, string tsid)
        {
            if (!string.IsNullOrEmpty(institutionID))
            {
                InstitutionID            = institutionID;
                Session["InstitutionID"] = InstitutionID;
            }

            if (!string.IsNullOrEmpty(guid))
            {
                GUID = guid;
            }

            if (!string.IsNullOrEmpty(tsid))
            {
                TSID = tsid;
            }


            // Get current Server from which EventLog is being monitored and display
            SetCurrentServer();

            // Get total memory used so far and set and display
            SetCurrentProcessMemorySize();

            Page1 = Page2 = Page3 = 1;

            Entry1 = GenListSetEligibilityRequest();
            ViewBag.SetEligibilityRequest = Entry1.ToPagedList(Page1, pageSize);

            Entry2 = GenListSetCardRequest();
            ViewBag.SetCardRequest = Entry2.ToPagedList(Page2, pageSize);

            Entry3 = GenListSetBenefitRequest();
            ViewBag.SetBenefitRequest = Entry3.ToPagedList(Page3, pageSize);


            setViewBags();

            return(View());
        }
Exemplo n.º 13
0
        public void TestConvertingMapToDictionaryWithExtendedMethod()
        {
            Entry1[] test = new Entry1[]
            {
                new Entry1()
                {
                    key = "1", value = 11
                },
                new Entry1()
                {
                    key = "21", value = 21
                }
            };
            IDictionary <String, int> result = test.ConvertMap <String, int>();

            foreach (Entry1 e1 in test)
            {
                Assert.IsTrue(result.ContainsKey(e1.key));
                Assert.AreEqual(result[e1.key], e1.value);
            }
        }
Exemplo n.º 14
0
        public void TestExtendMethodThatAddsOpenEngSBModel()
        {
            Entry1 testentry = new Entry1();

            testentry.key   = "Test";
            testentry.value = 2;

            List <openEngSBModelEntry> elements = new List <openEngSBModelEntry>();
            openEngSBModelEntry        osbEntry = new openEngSBModelEntry();

            osbEntry.key   = "key";
            osbEntry.type  = "type";
            osbEntry.value = "value";
            elements.Add(osbEntry);
            testentry = testentry.AddOpenEngSBModel <Entry1>(elements);
            IOpenEngSBModel objUnmarshalled = testentry as IOpenEngSBModel;

            Assert.AreEqual(elements.Count, objUnmarshalled.OpenEngSBModelTail.Count);
            Assert.AreEqual(objUnmarshalled.OpenEngSBModelTail[0].key, osbEntry.key);
            Assert.AreEqual(objUnmarshalled.OpenEngSBModelTail[0].type, osbEntry.type);
            Assert.AreEqual(objUnmarshalled.OpenEngSBModelTail[0].value, osbEntry.value);
            Assert.AreEqual(((Entry1)objUnmarshalled).key, testentry.key);
            Assert.AreEqual(((Entry1)objUnmarshalled).value, testentry.value);
        }
Exemplo n.º 15
0
        public void TestExtendMethodThatAddsOpenEngSBModel()
        {
            Entry1 testentry = new Entry1();
            testentry.key = "Test";
            testentry.value = 2;

            List<openEngSBModelEntry> elements = new List<openEngSBModelEntry>();
            openEngSBModelEntry osbEntry = new openEngSBModelEntry();
            osbEntry.key = "key";
            osbEntry.type = "type";
            osbEntry.value = "value";
            elements.Add(osbEntry);
            testentry = testentry.AddOpenEngSBModel<Entry1>(elements);
            IOpenEngSBModel objUnmarshalled = testentry as IOpenEngSBModel;

            Assert.AreEqual(elements.Count, objUnmarshalled.OpenEngSBModelTail.Count);
            Assert.AreEqual(objUnmarshalled.OpenEngSBModelTail[0].key, osbEntry.key);
            Assert.AreEqual(objUnmarshalled.OpenEngSBModelTail[0].type, osbEntry.type);
            Assert.AreEqual(objUnmarshalled.OpenEngSBModelTail[0].value, osbEntry.value);
            Assert.AreEqual(((Entry1)objUnmarshalled).key, testentry.key);
            Assert.AreEqual(((Entry1)objUnmarshalled).value, testentry.value);
        }
Exemplo n.º 16
0
 public void TestIfMapIsRecognizedAndIfVariablesAreDetectedCorrectlyAndCorrectConvertedFromJsonToObject()
 {
     IDictionary result = new Dictionary<String, String>();
     Entry1[] entry = new Entry1[]
     {
         new Entry1()
         {
             key = "Test", value = 123
         }
     };
     result.Add("123", new JsonMarshaller().MarshallObject(entry));
     EntryWithEntryParameter[] arrays = (EntryWithEntryParameter[])result.ConvertMap(typeof(EntryWithEntryParameter));
     Assert.IsTrue(arrays[0].key.Equals("123"));
     Assert.IsTrue(arrays[0].value[0].key.Equals("Test"));
 }
Exemplo n.º 17
0
 private void Entry2_OnCompleted(object sender, EventArgs e)
 {
     Entry1.Focus();
 }
Exemplo n.º 18
0
 public void TestConvertingMapToDictionaryWithExtendedMethod()
 {
     Entry1[] test = new Entry1[]
     {
         new Entry1() { key = "1", value = 11 },
         new Entry1()
         {
             key = "21", value = 21
         }
     };
     IDictionary<String, int> result = test.ConvertMap<String, int>();
     foreach (Entry1 e1 in test)
     {
         Assert.IsTrue(result.ContainsKey(e1.key));
         Assert.AreEqual(result[e1.key], e1.value);
     }
 }
 private void button1_clicked(object sender, EventArgs e)
 {
     Entry1.Focus();
 }
Exemplo n.º 20
0
        public void TestConvertDictionaryToEntry1WithParameterTypeAreEntry1AndInJsonFormat()
        {
            // This Test case checks if an object that is not an array is not recognized as Map and converted correctly
            IDictionary result = new Dictionary<String, String>();
            Entry1 keyEntry = new Entry1 { key = "Test", value = 123 };
            Entry1 valueEntry = new Entry1 { key = "ValueTest", value = 111 };
            result.Add(marshaller.MarshallObject(keyEntry), marshaller.MarshallObject(valueEntry));

            EntryWithAllEntryParameter[] arrays = (EntryWithAllEntryParameter[])result.ConvertMap(typeof(EntryWithAllEntryParameter));

            Assert.AreEqual<String>(arrays[0].key.key, keyEntry.key);
            Assert.AreEqual<int>(arrays[0].key.value, keyEntry.value);
            Assert.AreEqual<String>(arrays[0].value.key, valueEntry.key);
            Assert.AreEqual<int>(arrays[0].value.value, valueEntry.value);
        }