Пример #1
0
        public void clear()
        {
            cp s = new cp();

            textBox1.Text         = s.getsaleid().ToString();
            comboBox1.Text        = "";
            textBox2.Text         = "";
            textBox3.Text         = "";
            dateTimePicker1.Value = DateTime.Now;
        }
Пример #2
0
        public void loadrecord(int id)
        {
            int key = id;
            cp  s   = new cp();

            textBox1.Text = id.ToString();
            if (s.search(key))
            {
                comboBox1.Text       = s.name;
                textBox2.Text        = s.descri;
                dateTimePicker1.Text = s.date;
                textBox3.Text        = s.amt.ToString();
            }
        }
Пример #3
0
        private void button2_Click(object sender, EventArgs e)
        {
            cp c = new cp();

            c.no     = Convert.ToInt32(textBox1.Text.ToString());
            c.name   = comboBox1.Text.ToString();
            c.descri = textBox2.Text.ToString();
            c.date   = dateTimePicker1.Text;
            c.amt    = Convert.ToInt32(textBox3.Text);
            bool sucess = c.update();

            if (sucess)
            {
                MessageBox.Show("UPDATED SUCESSFULY", "DELETE");
            }
            else
            {
                MessageBox.Show("UPDATION UNSUCESSFULL", "DELETE");
            }
            clear();
        }