示例#1
0
 public static bool ThemTheLoai(TheLoaiDTO tl)
 {
     if (TheLoaiDAO.GetTheLoaiByName(tl.TenTheLoai) == null)
     {
         TheLoaiDAO.Insert(tl);
         return(true);
     }
     else
     {
         return(false);
     }
 }
示例#2
0
        private void btnimport_Click(object sender, EventArgs e)
        {
            string         oldPath = Directory.GetCurrentDirectory();
            OpenFileDialog of      = new OpenFileDialog();

            of.ShowDialog();
            string strPathName = of.FileName;

            Directory.SetCurrentDirectory(oldPath);
            DataTable dt = ExcelRead.getSheet(strPathName, "sheet1");

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                TheLoaiDTO tl = new TheLoaiDTO();
                tl.TenTheLoai = dt.Rows[i].ItemArray[1].ToString();
                TheLoaiDAO.Insert(tl);
            }
            MessageBox.Show("Import dữ liệu thành công ...", "Thông báo");
            HienThiDanhSach();
        }
示例#3
0
 public static void Insert(TheLoaiDTO theLoai)
 {
     TheLoaiDAO.Insert(theLoai);
 }
示例#4
0
 public void Insert(TheLoai info)
 {
     data.Insert(info);
 }
示例#5
0
 public int Insert(TheLoai obj)
 {
     return(DAO.Insert(obj));
 }