示例#1
0
        public List<TaiKhoanThuongDTO> SelectAllTaiKhoanThuong()
        {
            List<TaiKhoanThuongDTO> listTKDTO = new List<TaiKhoanThuongDTO>();

            List<TaiKhoanThuong> listTKT = (List<TaiKhoanThuong>)data.sp_TaiKhoanThuongXem();
            foreach (TaiKhoanThuong dh in listTKT)
            {
                TaiKhoanThuongDTO dhdto = new TaiKhoanThuongDTO(dh);
                listTKDTO.Add(dhdto);
            }

            return listTKDTO;
        }
示例#2
0
        public int InsertTaiKhoanThuong(TaiKhoanThuongDTO tk)
        {
            int kq = 0;

            try {
                data.sp_ins_taikhoanthuong(tk.MAKH1, tk.DIACHI1, tk.EMAIL1, tk.SDT1);
                data.SubmitChanges();
                kq = 1;
            }
            catch (Exception ex) { }

            return kq;
        }
示例#3
0
        protected void ButtonThemKH_Click(object sender, EventArgs e)
        {
            TaiKhoanThuongDTO tk = new TaiKhoanThuongDTO();
            tk.MAKH1 = int.Parse(txtMaKH.Text);
            tk.DIACHI1 = txtDC.Text;
            tk.EMAIL1 = txtEmail.Text;
            tk.SDT1 = txtSDT.Text;

            TaiKhoanThuongDAO tkDAO = new TaiKhoanThuongDAO();
            tkDAO.InsertTaiKhoanThuong(tk);
            txtMaKH.Text = "";
            txtDC.Text = "";
            txtEmail.Text = "";
            txtSDT.Text = "";
        }