예제 #1
0
        private void btn_xoa_Click(object sender, EventArgs e)
        {
            donthuoc d = new donthuoc();

            d.Madon = dg_donthuoc.Rows[dg_donthuoc.CurrentRow.Index].Cells[0].Value.ToString();
            donthuoc.delete(d);
            load_donthuoc();
        }
예제 #2
0
        public void delete(donthuoc dt)
        {
            openC();

            SqlCommand cmd = new SqlCommand("sp_delete_donthuoc", con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add(new SqlParameter("@madon", dt.Madon));


            cmd.ExecuteNonQuery();

            closeC();
        }
예제 #3
0
        void themdl()
        {
            donthuoc t = new donthuoc();

            t.Madon  = txt_madon.Text.ToString();
            t.Tendon = txt_tendon.Text;
            t.MaKH   = f.dg_khachhang.Rows[f.dg_khachhang.CurrentRow.Index].Cells[0].Value.ToString();
            string[] date = DateTime.Now.ToString().Split(' ');
            t.Ngay   = date[0];
            t.Ghichu = txt_ghichu.Text;
            t.Anh    = file_img;

            donthuoc.insert(t);
            f.load_donthuoc();
            this.Close();
        }
예제 #4
0
        public void update(donthuoc dt)
        {
            openC();

            SqlCommand cmd = new SqlCommand("sp_update_donthuoc", con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add(new SqlParameter("@madon", dt.Madon));
            cmd.Parameters.Add(new SqlParameter("@tendon", dt.Tendon));
            cmd.Parameters.Add(new SqlParameter("@ghichu", dt.Ghichu));
            cmd.Parameters.Add(new SqlParameter("@anh", dt.Anh));
            cmd.Parameters.Add(new SqlParameter("@ngay", dt.Ngay));
            cmd.Parameters.Add(new SqlParameter("@maKH", dt.MaKH));

            cmd.ExecuteNonQuery();

            closeC();
        }
예제 #5
0
 public void delete(donthuoc dt)
 {
     d.delete(dt);
 }
예제 #6
0
 public void update(donthuoc dt)
 {
     d.update(dt);
 }
예제 #7
0
 public void insert(donthuoc dt)
 {
     d.insert(dt);
 }