コード例 #1
0
ファイル: TheLoaiBUS.cs プロジェクト: viethuy20/git
 public static bool ThemTheLoai(TheLoaiDTO tl)
 {
     if (TheLoaiDAO.GetTheLoaiByName(tl.TenTheLoai) == null)
     {
         TheLoaiDAO.Insert(tl);
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #2
0
ファイル: frmquanlytheloai.cs プロジェクト: viethuy20/git
        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
ファイル: TheLoaiBUS.cs プロジェクト: lkh/thanhpham
 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));
 }