Beispiel #1
0
        public static bool kt_dangnhap(string ten, string matkhau)
        {
            //Lnhanvien nv = new Lnhanvien();
            try
            {
                KTdangnhap P   = new KTdangnhap();
                DataSet    ds1 = P.ds;
                ketnoi.ThietlapketNoi();
                laydulieu dl = new laydulieu();
                ds1 = dl.getdata("select * from nhanvien where matkhau = '" + matkhau + "' and tendangnhap = '" + ten + "'");
                if (ds1.Tables[0].Rows.Count == 0)
                {
                    ketnoi.HuyKetNoi(); return(false);
                }
                else
                {
                    strmanhanvien = ds1.Tables[0].Rows[0]["manhanvien"].ToString();
                    strhoten      = ds1.Tables[0].Rows[0]["hoten"].ToString();
                    strdiachi     = ds1.Tables[0].Rows[0]["diachi"].ToString();
                    strnguoidung  = ds1.Tables[0].Rows[0]["tendangnhap"].ToString();
                    strquyenhan   = ds1.Tables[0].Rows[0]["quyenhan"].ToString();


                    strmatkhau = ds1.Tables[0].Rows[0]["matkhau"].ToString();
                    ketnoi.HuyKetNoi();
                    return(true);
                }
            }
            catch { return(false); }
        }
Beispiel #2
0
        public bool kt_dangnhap(string ten, string matkhau, string tenserver)
        {
            //Lnhanvien nv = new Lnhanvien();
            try
            {
                if (tenserver != "")
                {
                    ketnoi.strcon = ketnoi.strcon + "; server= " + tenserver;
                }
                ketnoi.ThietlapketNoi();
                laydulieu dl = new laydulieu();
                ds = dl.getdata("select * from nhanvien where matkhau = '" + matkhau + "' and tendangnhap = '" + ten + "'");
                if (ds.Tables[0].Rows.Count == 0)
                {
                    ketnoi.HuyKetNoi(); return(false);
                }
                else
                {
                    strmanhanvien = ds.Tables[0].Rows[0]["manhanvien"].ToString();
                    strhoten      = ds.Tables[0].Rows[0]["hoten"].ToString();
                    strdiachi     = ds.Tables[0].Rows[0]["diachi"].ToString();
                    strnguoidung  = ds.Tables[0].Rows[0]["tendangnhap"].ToString();
                    strquyenhan   = ds.Tables[0].Rows[0]["quyenhan"].ToString();


                    strmatkhau = ds.Tables[0].Rows[0]["matkhau"].ToString();
                    ketnoi.HuyKetNoi();
                    return(true);
                }
            }
            catch { return(false); }
        }
        public static bool kt_nhapSoPhongDoi(string SoPhongDoi)
        {
            try
            {
                if (SoPhongDoi == "")
                {
                    return(true);
                }
                DataSet ds1 = new DataSet();


                ketnoi.ThietlapketNoi();
                laydulieu dl = new laydulieu();
                ds1 = dl.getdata("insert into khachhang(phongdon)values('" + SoPhongDoi + "')");
                return(false);
            }
            catch { return(true); }
        }
        public static bool kt_nhapTGThue(string TGThue)
        {
            try
            {
                if (TGThue == "")
                {
                    return(true);
                }
                DataSet ds1 = new DataSet();


                ketnoi.ThietlapketNoi();
                laydulieu dl = new laydulieu();
                ds1 = dl.getdata("insert into khachhang(songay)values('" + TGThue + "')");
                return(false);
            }
            catch { return(true); }
        }
Beispiel #5
0
        public static bool kt_trungmacheckin(string macheckin)
        {
            try
            {
                DataSet ds1 = new DataSet();

                ketnoi.ThietlapketNoi();
                laydulieu dl = new laydulieu();

                ds1 = dl.getdata("select * from checkin where macheckin = '" + macheckin + "' ");
                if (ds1.Tables[0].Rows.Count == 0)
                {
                    ketnoi.HuyKetNoi(); return(true);
                }
                else
                {
                    MessageBox.Show("Mã check in đã tồn tại!", "Chú ý");
                    ketnoi.HuyKetNoi();
                    return(false);
                }
            }
            catch { return(true); }
        }