예제 #1
0
        public bool Check1(QuanLyObj qlObj)
        {
            DataTable dt = new DataTable();

            cmd.CommandText = "Select Count(*) From QUANLY where taikhoan='admin'and matkhau='" + qlObj.MatKhau + "'";
            cmd.CommandType = CommandType.Text;
            cmd.Connection  = con.Connection;
            try
            {
                SqlDataAdapter sda = new SqlDataAdapter(cmd);
                sda.Fill(dt);
                if (dt.Rows[0][0].ToString() == "1")
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                string mex = ex.Message;
                cmd.Dispose();
                con.CloseConn();
            }
            return(false);
        }
예제 #2
0
 public bool UpdDataTenAdmin(QuanLyObj qlObj)
 {
     cmd.CommandText = "Update QUANLY set ten = N'" + qlObj.Ten + "' Where taikhoan = 'admin'";
     cmd.CommandType = CommandType.Text;
     cmd.Connection  = con.Connection;
     try
     {
         con.OpenConn();
         cmd.ExecuteNonQuery();
         return(true);
     }
     catch (Exception ex)
     {
         string mex = ex.Message;
         cmd.Dispose();
         con.CloseConn();
     }
     return(false);
 }
예제 #3
0
        public bool AddDataQL(QuanLyObj qlObj)
        {
            cmd.CommandText = "Insert into QUANLY values ('" + qlObj.ID + "','" + qlObj.Taikhoan + "','" + qlObj.MatKhau + "',N'" + qlObj.Ten + "')";
            cmd.CommandType = CommandType.Text;
            cmd.Connection  = con.Connection;

            try
            {
                con.OpenConn();
                cmd.ExecuteNonQuery();
                con.CloseConn();
            }
            catch (Exception ex)
            {
                string mex = ex.Message;
                cmd.Dispose();
                con.CloseConn();
            }


            return(false);
        }
예제 #4
0
 void ganDulieuQL(QuanLyObj qlObj)
 {
     qlObj.Taikhoan = txtTaiKhoan.Text.Trim();
     qlObj.MatKhau  = toMD5(txtMatKhau.Text);// txtMatKhau.Text.Trim();
 }
예제 #5
0
 public bool check1(QuanLyObj qlObj)
 {
     return(qlMod.Check1(qlObj));
 }
예제 #6
0
 public bool updDateTenAdmin(QuanLyObj qlObj)
 {
     return(qlMod.UpdDataTenAdmin(qlObj));
 }
예제 #7
0
 public bool updDate(QuanLyObj qlObj)
 {
     return(qlMod.UpdData(qlObj));
 }
예제 #8
0
 public bool addDataQL(QuanLyObj qlObj)
 {
     return(qlMod.AddDataQL(qlObj));
 }