public FormularEditare(NoteClass pLC)
        {
            InitializeComponent();
            workingNC = pLC;

            labelID.Text = pLC.v_ID;
            NumeTB.Text = pLC.v_Nume;
            TIPCB.Text = pLC.v_Tip;
            LansareDTP.Value = pLC.v_Lansare;
            NotificareChB.Checked = pLC.v_Repetare;
            NrNotTB.Text = pLC.v_NumarRepetari.ToString();
            ModRepetareCB.Text = pLC.v_ModRepetare;
            InteresCB.Text = pLC.v_Interes;
            DescriereRTB.Text = pLC.v_Descriere;

            if (NotificareChB.Checked)
            {
                ModRepetareCB.Enabled = true;
                NrNotTB.Enabled = true;
            }
            else
            {
                ModRepetareCB.Enabled = false;
                NrNotTB.Enabled = false;
            }
        }
Ejemplo n.º 2
0
        public List<NoteClass> Select(string condition = "ID <> 0")
        {
            List<NoteClass> tempNC = new List<NoteClass>();

            string sql = "select * from tableDATA WHERE " + condition ;
            SQLiteCommand command = new SQLiteCommand(sql, m_dbConnection);
            SQLiteDataReader reader = command.ExecuteReader();
            while (reader.Read())
            {
                NoteClass tNC = new NoteClass();
                tNC.v_ID = reader["ID"].ToString();
                tNC.v_Tip = reader["TIP"].ToString();
                tNC.v_Nume = reader["NUME"].ToString();
                tNC.v_Lansare = DateTime.Parse(reader["LANSARE"].ToString());
                tNC.v_Repetare = reader["REPETARE"].ToString().Equals("1");
                tNC.v_ModRepetare = reader["MODREPETARE"].ToString();
                tNC.v_NumarRepetari = Convert.ToInt16(reader["NUMARREPETARI"].ToString());
                tNC.v_Interes = reader["INTERES"].ToString();
                tNC.v_Descriere = reader["DESCRIERE"].ToString();
                tNC.v_UltimaNotif = DateTime.Parse(reader["ULTIMANOTIF"].ToString());

                tempNC.Add(tNC);
            }
            return tempNC;
        }