コード例 #1
0
        private void functionCmbDataChanged(ComboBox cmb)
        {
            if (cmb.SelectedIndex != -1)
            {
                try
                {
                    _InCaricamento = true;

                    IDRelazioneB = htDate[cmb.SelectedIndex].ToString();

                    MasterFile mf           = MasterFile.Create();
                    Hashtable  htRelazioneB = new Hashtable();

                    htRelazioneB            = mf.GetRelazioneB(IDRelazioneB);
                    dtpDataNomina.IsEnabled = true;
                    txtNota.IsEnabled       = true;

                    foreach (DictionaryEntry item in htSelectedDate)
                    {
                        if (item.Value.ToString() == ConvertDataToEsercizio(htRelazioneB["Data"].ToString(), htRelazioneB))
                        {
                            dtpDataNomina.SelectedIndex = Convert.ToInt32(item.Key.ToString());
                        }
                    }

                    txtNota.Text = htRelazioneB["Note"].ToString();

                    _InCaricamento = false;
                }
                catch (Exception ex)
                {
                    cBusinessObjects.logger.Error(ex, "wSchedaRelazioneB.functionCmbDataChanged exception");
                    string log = ex.Message;
                }
            }
        }
コード例 #2
0
        //----------------------------------------------------------------------------+
        //                                   accedi                                   |
        //----------------------------------------------------------------------------+
        public void accedi(string ID, bool ReadOnly)
        {
            MasterFile mf         = MasterFile.Create();
            Hashtable  htSelected = mf.GetRelazioneB(ID);

            if (htSelected.Count == 0)
            {
                return;
            }
            WindowWorkAreaTree wWorkArea = new WindowWorkAreaTree();

            //Prisc
            try
            {
                wWorkArea.Owner = this;
            }
            catch (Exception ex)
            {
                cBusinessObjects.logger.Error(ex, "wSchedaRelazioneB.accedi exception");
                string log = ex.Message;
            }
            wWorkArea.SelectedTreeSource = App.AppDataDataFolder + "\\" + htSelected["File"].ToString();
            wWorkArea.SelectedDataSource = App.AppDataDataFolder + "\\" + htSelected["FileData"].ToString();
            if (htSelected["Sigillo"] != null && htSelected["Sigillo"].ToString() != "")
            {
                wWorkArea.ReadOnly = true;
            }
            else
            {
                wWorkArea.ReadOnly = ReadOnly;
            }
            wWorkArea.TipoAttivita            = App.TipoAttivita.RelazioneB;
            wWorkArea.Cliente                 = (((Hashtable)(mf.GetAnagrafica(Convert.ToInt32(htSelected["Cliente"].ToString()))))["RagioneSociale"].ToString()) + " (C.F. " + (((Hashtable)(mf.GetAnagrafica(Convert.ToInt32(htSelected["Cliente"].ToString()))))["CodiceFiscale"].ToString()) + ")";
            wWorkArea.SessioneAlias           = "";
            wWorkArea.SessioneFile            = "";
            wWorkArea.SessioneSigillo         = null;
            wWorkArea.SessioneSigilloData     = null;
            wWorkArea.SessioneSigilloPassword = null;
            wWorkArea.IDTree     = (Convert.ToInt32(App.TipoFile.RelazioneB)).ToString();
            wWorkArea.IDCliente  = htSelected["Cliente"].ToString();
            wWorkArea.IDSessione = ID;
            foreach (Hashtable item in ((ArrayList)(mf.GetRelazioniB(htSelected["Cliente"].ToString()))))
            {
                wWorkArea.SessioneFile            += ((wWorkArea.SessioneFile == "") ? "" : "|") + App.AppDataDataFolder + "\\" + item["FileData"].ToString();
                wWorkArea.SessioneAlias           += ((wWorkArea.SessioneAlias == "") ? "" : "|") + item["Data"].ToString();// ConvertDataToEsercizio(item["Data"].ToString());
                wWorkArea.SessioneID              += ((wWorkArea.SessioneID == "") ? "" : "|") + item["ID"].ToString();
                wWorkArea.SessioneSigillo         += ((wWorkArea.SessioneSigillo == null) ? "" : "|") + ((item["Sigillo"] != null) ? item["Sigillo"].ToString() : "");
                wWorkArea.SessioneSigilloData     += ((wWorkArea.SessioneSigilloData == null) ? "" : "|") + ((item["Sigillo_Data"] != null) ? item["Sigillo_Data"].ToString() : "");
                wWorkArea.SessioneSigilloPassword += ((wWorkArea.SessioneSigilloPassword == null) ? "" : "|") + ((item["Sigillo_Password"] != null) ? item["Sigillo_Password"].ToString() : "");
            }
            //aperto in sola lettura
            wWorkArea.ApertoInSolaLettura = TipologiaAttivita == App.TipoAttivitaScheda.View;
            wWorkArea.LoadTreeSource();
            Hide();
            wWorkArea.ShowDialog();
            if (TipologiaAttivita != App.TipoAttivitaScheda.View)
            {
                int IDCliente = Convert.ToInt32(htClienti[cmbClienti.SelectedIndex].ToString());
                mf.SetAnafraficaStato(Convert.ToInt32(IDCliente), App.TipoAnagraficaStato.Disponibile);
            }
            Close();
        }