public DocumentiEdit(ref Fatture f, ref bool nuova)
        {
            this.doc   = f;
            this.nuova = nuova;
            last_num_  = 0;
            dbcon_     = DependencyService.Get <ISQLiteDb>().GetConnection();

            InitializeComponent();
            switch (this.doc.fat_tipo)
            {
            case (int)DocTipo.TIPO_DDT:
                Title = "Documento di Trasporto";
                break;

            case (int)DocTipo.TIPO_FAT:
                Title = "Fattura";
                break;

            case (int)DocTipo.TIPO_PRE:
                Title = "Preventivo";
                break;

            case (int)DocTipo.TIPO_ORD:
                Title = "Ordine";
                break;

            default:
                Title = "*** Documento Sconosciuto ***";
                break;
            }
            ChildAdded += OnChildAdded;


            headerPage_       = new DocumentiHeader(this);
            headerPage_.Title = "Testata";
            headerPage_.Icon  = "ic_perm_identity_white.png";

            body_           = new DocumentiBody(this);
            bodyPage_       = new NavigationPage(body_);
            bodyPage_.Title = "Corpo";
            bodyPage_.Icon  = "ic_view_headline_white.png";

            footer_           = new DocumentiFooter(this);
            footerPage_       = new NavigationPage(footer_);
            footerPage_.Title = "Piede";
            footerPage_.Icon  = "ic_euro_symbol_white.png";

            note_           = new DocumentiNote(this);
            notePage_       = new NavigationPage(note_);
            notePage_.Title = "Note";
            notePage_.Icon  = "ic_mode_edit_white.png";

            Children.Add(headerPage_);
            Children.Add(bodyPage_);
            Children.Add(footerPage_);
            Children.Add(notePage_);
        }
Ejemplo n.º 2
0
        public DocumentRow(DocumentiBody par, ref FatRow rig, int index = -1, bool editable = true)
        {
            par_      = par;
            rig_      = rig;
            change_   = false;
            first_    = true;
            index_    = index;
            editable_ = editable;
            InitializeComponent();

            //var culture = new CultureInfo("en-US");
            //m_quantita.Culture = culture;
            //m_prezzo.Culture = culture;
            //m_sco1.Culture = culture;
            //m_sco2.Culture = culture;
            //m_sco3.Culture = culture;
            //m_totale.Culture = culture;

            //
            // Rimuoviamo le righe per i lotti se non gestiti
            //
            if (!((App)Application.Current).facile_db_impo.dit_usa_lotti)
            {
                int x = 0;
                foreach (var row in m_grid.RowDefinitions)
                {
                    if (x == 9 || x == 10)
                    {
                        row.Height = 0;
                    }
                    x++;
                }
            }

            NavigationPage.SetHasNavigationBar(this, false);
            dbcon_ = DependencyService.Get <ISQLiteDb>().GetConnection();

            m_image.Source = null;
            if (Device.RuntimePlatform == Device.iOS)
            {
                Padding = new Thickness(0, 30, 0, 0);
            }

            if (Device.Idiom == TargetIdiom.Tablet)
            {
                if (((App)Application.Current).facile_db_impo.dit_usa_lotti)
                {
                    m_image_box.HeightRequest = 350;
                }
                else
                {
                    m_image_box.HeightRequest = 500;
                }
            }

            if (index_ == -1)
            {
                m_elimina.IsEnabled = false;
                m_elimina.IsVisible = false;
            }

            if (!editable_)
            {
                m_art.IsEnabled    = false;
                m_search.IsEnabled = false;

                m_salva.IsEnabled   = false;
                m_elimina.IsEnabled = false;

                m_salva.IsVisible   = false;
                m_elimina.IsVisible = false;

                m_quantita.IsEnabled     = false;
                m_prezzo.IsEnabled       = false;
                m_sco1.IsEnabled         = false;
                m_sco2.IsEnabled         = false;
                m_sco3.IsEnabled         = false;
                m_sostituzione.IsEnabled = false;

                m_qta_down.IsEnabled = false;
                m_qta_up.IsEnabled   = false;

                m_prezzo_down.IsEnabled = false;
                m_prezzo_up.IsEnabled   = false;

                m_sco1_down.IsEnabled = false;
                m_sco1_up.IsEnabled   = false;

                m_sco2_down.IsEnabled = false;
                m_sco2_up.IsEnabled   = false;

                m_sco3_down.IsEnabled = false;
                m_sco3_up.IsEnabled   = false;

                m_search_lotto.IsEnabled = false;
            }

            if (Device.RuntimePlatform == Device.Android)
            {
                m_esci.IsEnabled = false;
                m_esci.IsVisible = false;
            }

            m_quantita.Culture = new CultureInfo("it-IT");
            m_prezzo.Culture   = new CultureInfo("it-IT");
            m_sco1.Culture     = new CultureInfo("it-IT");
            m_sco2.Culture     = new CultureInfo("it-IT");
            m_sco3.Culture     = new CultureInfo("it-IT");
            m_totale.Culture   = new CultureInfo("it-IT");
            SetField();
        }