Ejemplo n.º 1
0
        public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
        {
            ISupportEmpphotosorce selectedItem = Data[indexPath.Row];

            // normal iOS behaviour is to remove the blue highlight
            tableView.DeselectRow(indexPath, true);

            if (OnRowSelected != null)
            {
                OnRowSelected(this, new RowSelectedEventArgs(tableView, indexPath));
            }
        }
        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 <LabourListDTO> >(TimeCapServices.LaborMaster,
                                                                                new Dictionary <string, string>() { { "username", "test-fe91" }, { "role", "timekeeper" } });

            var tablesource = new EmpPhotoTablesource();

            var data = new List <ISupportEmpphotosorce>();

            foreach (var item in response.Value)
            {
                if (!Employeeexist.Contains(item.EmployeePersonnelNumber.ToString()))
                {
                    NSData  imagedata = new NSData(item.EmployeePhoto, NSDataBase64DecodingOptions.IgnoreUnknownCharacters);
                    UIImage image     = new UIImage(imagedata);
                    imageView       = new UIImageView(image);
                    imageView.Image = image;
                    data.Add(new Empphotodata()
                    {
                        EmployeePersonnelName = item.EmployeePersonnelName, EmployeePersonnelNumber = item.EmployeePersonnelNumber.ToString(), EmployeePhoto = image
                    });
                }
            }
            tablesource.Data           = data;
            tablesource.OnRowSelected += (object sender, EmpPhotoTablesource.RowSelectedEventArgs e) =>
            {
                ISupportEmpphotosorce selectedItem = tablesource.Data[e.indexPath.Row];
                labrsignout = new LabourListDTO
                {
                    WorkDate = Convert.ToDateTime(wrkdt),
                    TimekeeperPersonnelNumber = Convert.ToInt32(timenum),
                    TimekeeperPersonnelName   = timekprname.ToString(),
                    EmployeePersonnelNumber   = Convert.ToInt32(selectedItem.EmployeeNumber),
                    EmployeePersonnelName     = selectedItem.EmployeeName,
                    CreateDate     = Convert.ToDateTime(wrkdt),
                    CreateUser     = Convert.ToString(timekprname),
                    LastChangeDate = Convert.ToDateTime(wrkdt),
                    LastChangeUser = Convert.ToString(timekprname),
                    UpdateFlag     = "I",
                };
                var d = DoSaveData();
            };

            TableView.Source = tablesource;
            TableView.ReloadData();
        }
 public void setTimekeeper(Timekeeperlistviewcontroller timekeeperlistviewcontroller, ISupportEmpphotosorce supportEmpphotosorce)
 {
     Timekprno  = supportEmpphotosorce.EmployeeNumber.ToString();
     Timekprnme = supportEmpphotosorce.EmployeeName;
 }
 public void SetLaborList(EmployeeListSignoutViewController employeeListSignoutViewController, ISupportEmpphotosorce supportEmpphotosorce, string Workdate)
 {
     employeenum  = supportEmpphotosorce.EmployeeNumber.ToString();
     employeename = supportEmpphotosorce.EmployeeName.ToString();
     workdt       = Workdate.ToString();
 }