async Task DoLoadData()
        {
            ModernHttpClient.NativeMessageHandler m          = new ModernHttpClient.NativeMessageHandler();
            Newtonsoft.Json.JsonSerializer        serializer = new Newtonsoft.Json.JsonSerializer();
            JsonClient client = new JsonClient(serializer);

            var response = await client.GetAsync <IEnumerable <EquipmentMasterDTO> >(TimeCapServices.EquipList,
                                                                                     new Dictionary <string, string>() { { "timeKeeperPersonnelNumber", Timekprnum.ToString() }, { "workDate", Wrkdt.ToString() } });

            var responseimag = await client.GetAsync <IEnumerable <EquipmentMasterDTO> >(TimeCapServices.EquipmentMaster,
                                                                                         new Dictionary <string, string>() { { "username", "test-fe91" }, { "role", "timekeeper" } });

            var tableSource = new EquipmentListTableSource();
            HashSet <string> equipmentnum = new HashSet <string>();
            var data = new List <EquiplistRowData>();

            foreach (var item in response.Value)
            {
                if (!equipmentnum.Contains(item.EquipmentNumber))
                {
                    List <object> Equipmentnumber = new List <object>();
                    Equipmentnumber.Add(item.EquipmentNumber);
                    foreach (var items in responseimag.Value)
                    {
                        if (Equipmentnumber.Contains(items.EquipmentNumber))
                        {
                            NSData  imagedata = new NSData(items.Photo, NSDataBase64DecodingOptions.IgnoreUnknownCharacters);
                            UIImage image     = new UIImage(imagedata);
                            imageView       = new UIImageView(image);
                            imageView.Image = image;
                            data.Add(new EquiplistRowData()
                            {
                                EquipmentNumber      = item.EquipmentNumber,
                                EquipmentDescription = item.EquipmentDescription,
                                Equipmentphoto       = image,
                                AllocatedHours       = item.EquipmentSerialNumber
                            });
                        }
                    }
                }
            }
            tableSource.Data           = data;
            tableSource.OnRowSelected += (object sender, EquipmentListTableSource.RowSelectedEventArgs e) =>
            {
                var empalloc = Storyboard.InstantiateViewController("AllocationViewcontroller") as AllocationViewcontroller;
                empalloc.equipmntdata(this, tableSource.Data);
                NavigationController.PushViewController(empalloc, true);
            };
            TableView.Source = tableSource;
            TableView.ReloadData();
        }
Beispiel #2
0
        async Task DoLoadData()
        {
            ModernHttpClient.NativeMessageHandler m          = new ModernHttpClient.NativeMessageHandler();
            Newtonsoft.Json.JsonSerializer        serializer = new Newtonsoft.Json.JsonSerializer();
            JsonClient client = new JsonClient(serializer);

            string timekeepernum = lbltimekeeperid.Text;

            var response = await client.GetAsync <IEnumerable <EquipmentMasterDTO> >(TimeCapServices.EquipmentMaster,
                                                                                     new Dictionary <string, string>() { { "username", "test-fe91" }, { "role", "timekeeper" } });

            var tableSource = new EquipmentListTableSource();

            var           data            = new List <EquiplistRowData>();
            HashSet <int> employeeNumbers = new HashSet <int>();

            foreach (var item in response.Value)
            {
                if (!objectNumbers.Contains(item.EquipmentNumber))
                {
                    data.Add(new EquiplistRowData()
                    {
                        EquipmentDescription = item.EquipmentDescription, EquipmentNumber = item.EquipmentNumber
                    });
                }
            }
            tableSource.Data           = data;
            tableSource.OnRowSelected += (object sender, EquipmentListTableSource.RowSelectedEventArgs e) =>
            {
                EquiplistRowData equimaster = tableSource.Data[e.indexPath.Row];
                equipList = new EquipmentMasterDTO
                {
                    Workdate = Convert.ToDateTime(wrkdt),
                    TimekeeperPersonnelNumber = Convert.ToInt32(timenum),
                    TimekeeperPersonnelName   = timekprname.ToString(),
                    EquipmentNumber           = equimaster.EquipmentNumber,
                    EquipmentDescription      = equimaster.EquipmentDescription,
                    EquipmentSerialNumber     = equimaster.EquipmentSerialNumber,
                    EquipmentClassCode        = equimaster.EquipmentClassCode,
                    CreateDate     = Convert.ToDateTime(wrkdt),
                    CreateUser     = timekprname.ToString(),
                    LastChangeDate = Convert.ToDateTime(wrkdt),
                    LastChangeUser = timekprname.ToString(),
                    UpdateFlag     = "I",
                };

                var equi = DoSaveData();
            };
            TableView.Source = tableSource;
            TableView.ReloadData();
        }
Beispiel #3
0
        async Task DoLoadData()
        {
            Newtonsoft.Json.JsonSerializer serializer = new Newtonsoft.Json.JsonSerializer();
            JsonClient client = new JsonClient(serializer);

            var response = await client.GetAsync <IEnumerable <EquipmentMasterDTO> >(TimeCapServices.EquipList,
                                                                                     new Dictionary <string, string>() { { "timeKeeperPersonnelNumber", timekprnum.ToString() }, { "workDate", wrkdt.ToString() } });

            var responseimag = await client.GetAsync <IEnumerable <EquipmentMasterDTO> > (TimeCapServices.EquipmentMaster,
                                                                                          new Dictionary <string, string> () { { "username", "test-fe91" }, { "role", "timekeeper" } });

            var tableSource = new EquipmentListTableSource();
            HashSet <string> equipmentnum = new HashSet <string>();
            var data = new List <EquiplistRowData>();

            foreach (var item in response.Value)
            {
                if (!equipmentnum.Contains(item.EquipmentNumber))
                {
                    List <object> Equipmentnumber = new List <object> ();
                    Equipmentnumber.Add(item.EquipmentNumber);
                    foreach (var items in responseimag.Value)
                    {
                        if (Equipmentnumber.Contains(items.EquipmentNumber))
                        {
                            NSData  imagedata = new NSData(items.Photo, NSDataBase64DecodingOptions.IgnoreUnknownCharacters);
                            UIImage image     = new UIImage(imagedata);
                            imageView       = new UIImageView(image);
                            imageView.Image = image;
                            data.Add(new EquiplistRowData()
                            {
                                EquipmentNumber      = item.EquipmentNumber,
                                EquipmentDescription = item.EquipmentDescription,
                                Equipmentphoto       = image
                            });
                        }
                    }
                }
            }
            tableSource.Data           = data;
            tableSource.OnRowSelected += (object sender, EquipmentListTableSource.RowSelectedEventArgs e) =>
            {
                new UIAlertView("Selected", tableSource.Data[e.indexPath.Row].ToString(), null, "ok", null).Show();
            };
            TableView.Source = tableSource;
            TableView.ReloadData();
        }
Beispiel #4
0
        async Task DoLoadData()
        {
            Newtonsoft.Json.JsonSerializer serializer = new Newtonsoft.Json.JsonSerializer();
            JsonClient client = new JsonClient(serializer);

            var response = await client.GetAsync <IEnumerable <LaborListDTO> >(TimeCapServices.DailyLog,
                                                                               new Dictionary <string, string>() { { "timeKeeperPersonnelNumber", "1000000002" }, { "workDate", "2014-09-24" } });

            var tableSource = new EquipmentListTableSource();

            var data = new List <EquiplistRowData>();

            foreach (var item in response.Value)
            {
            }
            tableSource.Data           = data;
            tableSource.OnRowSelected += (object sender, EquipmentListTableSource.RowSelectedEventArgs e) =>
            {
                new UIAlertView("row selected", "", null, "ok", null).Show();
            };
            TableView.Source = tableSource;
            TableView.ReloadData();
        }