Beispiel #1
0
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            UITableViewCell cell;

            if (indexPath.Row % 2 == 0)
            {
                cell = tableView.DequeueReusableCell(celdaBlack) as CustomSolMaqCellBlack;
                if (cell == null)
                {
                    cell = new CustomSolMaqCellBlack((NSString)celdaBlack);
                }
            }
            else
            {
                cell = tableView.DequeueReusableCell(celda) as CustomSolMaqCellWhite;
                if (cell == null)
                {
                    cell = new CustomSolMaqCellWhite((NSString)celda);
                }
            }

            clsSolicitudesMaquinas sol = lstsol.ElementAt(indexPath.Row);

            ((CustomSolMaqCell)cell).UpdateCell(sol.cantidad.ToString(), sol.equipo, sol.marca, sol.modelo);

            cell.Accessory = UITableViewCellAccessory.None;


            return(cell);
        }
Beispiel #2
0
        public async override void ViewDidLoad()
        {
            base.ViewDidLoad();

            if (UIScreen.MainScreen.Bounds.Width == 414)
            {
                scrViewSolicitudMaquina.ContentSize = new CoreGraphics.CGSize(359, 1783);
            }
            else
            {
                scrViewSolicitudMaquina.ContentSize = new CoreGraphics.CGSize(316, 1783);
            }

            btnAgregar.Layer.CornerRadius = 10;
            btnAgregar.ClipsToBounds      = true;

            btnlimpiar.Layer.CornerRadius = 10;
            btnlimpiar.ClipsToBounds      = true;

            btnSolicitar.Layer.CornerRadius = 10;
            btnSolicitar.ClipsToBounds      = true;

            lstRequerimientos.Layer.BorderColor = UIColor.Black.CGColor;
            lstRequerimientos.Layer.BorderWidth = (nfloat)2.0;
            lstsolmaq.Clear();
            lstRequerimientos.Source = new FuenteTablaRequerimientos(lstsolmaq);

            var bounds = UIScreen.MainScreen.Bounds;

            loadPop = new LoadingOverlay(bounds, "Cargando Datos ...");
            View.Add(loadPop);

            String folio = await getFolio();

            if (folio == "")
            {
                this.NavigationController.PopToRootViewController(true);
            }

            txtRequerimiento.Text = folio;

            String fecha = await getFechaHoraActual();

            if (fecha == "")
            {
                this.NavigationController.PopToRootViewController(true);
            }

            txtSolicitud.Text = fecha;

            lstResponsables = new List <clsCmbUsuarios>();

            Boolean respus = await getUsuarios();

            if (!respus)
            {
                this.NavigationController.PopToRootViewController(true);
            }

            lstAreasObra = new List <clsCmbObras>();

            Boolean respareas = await getAreasObra();

            if (!respareas)
            {
                this.NavigationController.PopToRootViewController(true);
            }

            loadPop.Hide();

            inicializaCombos();

            btnAgregar.TouchUpInside += delegate {
                if (txtCantidad.Text == "")
                {
                    funciones.MessageBox("Error", "Debe de ingresar una cantidad");
                    return;
                }

                int intcant;
                if (!Int32.TryParse(txtCantidad.Text, System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.CreateSpecificCulture("en-US"), out intcant))
                {
                    funciones.MessageBox("Error", "La cantidad ingresada debe de ser numercia");
                    return;
                }

                if (txtEquiposolicitado.Text == "")
                {
                    funciones.MessageBox("Error", "Debe de seleccionar un equipo para agregar");
                    return;
                }

                if (txtModelo.Text == "")
                {
                    funciones.MessageBox("Error", "Debe de seleccionar un modelo para agregar");
                    return;
                }

                if (txtmarca.Text == "")
                {
                    funciones.MessageBox("Error", "Debe de seleccionar una marca para agregar");
                    return;
                }



                clsSolicitudesMaquinas objsol = new clsSolicitudesMaquinas();
                objsol.cantidad = Int32.Parse(txtCantidad.Text);
                objsol.equipo   = txtEquiposolicitado.Text;
                objsol.marca    = txtmarca.Text;
                objsol.modelo   = txtModelo.Text;

                lstsolmaq.Add(objsol);

                lstRequerimientos.ReloadData();

                limpiaseleccion();
            };

            btnlimpiar.TouchUpInside += delegate {
                lstsolmaq.Clear();
                lstRequerimientos.ReloadData();
                limpiaseleccion();
            };



            btnSolicitudFecha.TouchUpInside += DatePickerButtonTapped;

            btnSolicitar.TouchUpInside += guardarSolicitud;

            bajatecladoinputs();
        }