Ejemplo n.º 1
0
      public static string check_db_ThongTinMuon(string madg, string masach, string sophieumuon, string ngaymuon, string ngaytra, string xacnhan, string ghichu, string temp)
      {
          try
          {
              Class.clsDatabase cls = new QuanLyThuVien.Class.clsDatabase();


              string strInsert = "Insert Into tblMuon(MADG,MASACH,SOPHIEUMUON,NGAYMUON,NGAYTRA,XACNHANTRA,GHICHU) values ('" + madg + "','" + masach + "','" + sophieumuon + "','" + ngaymuon + "','" + ngaytra + "','" + xacnhan + "','" + ghichu + "')";

              cls.ThucThiSQLTheoPKN(strInsert);

              return("0");
          }
          catch { Exception ex;  return("Trùng mã phiếu mượn"); };
      }
Ejemplo n.º 2
0
 public static string check_TaoTaiKhoan(string id, string pass, string confpass)
 {
     if (id.Length - 1 < 5)
     {
         return("Id too short");
     }
     else
     if (id.Length - 1 > 30)
     {
         return("Id too long");
     }
     else
     if (pass.Length - 1 < 5)
     {
         return("Pass too short");
     }
     else
     if (pass.Length - 1 > 30)
     {
         return("Pass too long");
     }
     else
     if (pass != confpass)
     {
         return("Pass not same");
     }
     else
     {
         try
         {
             Class.clsDatabase cls = new QuanLyThuVien.Class.clsDatabase();
             cls.KetNoi();
             cls.ThucThiSQLTheoPKN("insert into tblNhanVien(TAIKHOAN,MATKHAU,QUYENHAN)values('" + id + "','" + pass + "','user')");
             //cls.ThucThiSQLTheoPKN("delete tblNhanVien where id = '" + id+"'");
             return("0");
         }
         catch { return("Existed account"); }
     }
 }