Пример #1
0
        public void registerFront(Front front, ArrayList contactNos)
        {
            string empid = front.getempid();

            string first_name = front.getfname();
            string last_name  = front.getlname();
            string addressl1  = front.getaddressl1();
            string street     = front.getstreet();
            string city       = front.getcity();
            string gender     = front.getgender();

            DateTime dob = front.getdob();


            conn.Open();

            SqlCommand cmd = new SqlCommand("insert into front_office_clerks values ('" + empid + "', '" + first_name + "','" + last_name + "','" + addressl1 + "','" + street + "','" + city + "','" + gender + "', '" + dob + "')", conn);

            cmd.ExecuteNonQuery();

            SqlCommand cmd1 = new SqlCommand("insert into employee_contact_nos values('" + empid + "','" + contactNos[0] + "' )", conn);
            SqlCommand cmd2 = new SqlCommand("insert into employee_contact_nos values('" + empid + "','" + contactNos[1] + "')", conn);

            cmd1.ExecuteNonQuery();
            cmd2.ExecuteNonQuery();

            conn.Close();
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            FrontDBO adbo = new FrontDBO();

            string empid = txtempid.Text.Trim();

            string fname     = txtfname.Text.Trim();
            string lname     = txtlname.Text.Trim();
            string addressl1 = txtaddressl1.Text.Trim();
            string street    = txtstreet.Text.Trim();
            string city      = txtcity.Text.Trim();
            string gender    = comboBox1.Text.Trim();

            DateTime dob = dateTimePicker1.Value;


            Front front = new Front(empid, fname, lname, addressl1, street, city, gender, dob);

            ArrayList list = new ArrayList();

            list.Add(txthome.Text.Trim());
            list.Add(txtmobile.Text.Trim());

            adbo.registerFront(front, list);
            MessageBox.Show("Front office clerk registration succesfully!!!");
        }