Ejemplo n.º 1
0
 //获取账号ID
 public int UserId()
 {
     AccessDB myObj = new AccessDB();
     myObj.SqlStr = "select UserID from TXL_Users where UserName='******'";
     OleDbDataReader myReader = myObj.ExecuteSqlStrReturnDr();
     if (myReader.Read())
         return int.Parse(myReader["UserID"].ToString());
     else
         return -1;
 }
Ejemplo n.º 2
0
 //根据账号检测安全问题
 //public ArrayList GetQuestion()
 //{
 //    ArrayList tmpList = new ArrayList();
 //    AccessDB myObj = new AccessDB();
 //    myObj.SqlStr = "select Question from TXL_Safe where UserName='******'";
 //    OleDbDataReader myReader = myObj.ExecuteSqlStrReturnDr();//返回记录集
 //    while (myReader.Read())
 //    {
 //        tmpList.Add(myReader["Question"].ToString());
 //    }
 //    myReader.Close();
 //    return tmpList;
 //}
 public string GetQuestion()
 {
     AccessDB myObj = new AccessDB();
     myObj.SqlStr = "select * from TXL_Safe where UserName='******'";
     OleDbDataReader myReader = myObj.ExecuteSqlStrReturnDr();//返回记录集
     if (myReader.Read())
         return myReader["Question"].ToString();
     else
         return "账号不存在";
 }
Ejemplo n.º 3
0
 public bool login()
 {
     AccessDB myObj = new AccessDB();
     myObj.SqlStr = "select * from TXL_Users where UserName='******' and Pass='******'";
     OleDbDataReader myReader = myObj.ExecuteSqlStrReturnDr();//返回记录集
     if (myReader.Read())
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Ejemplo n.º 4
0
 //显示密码
 public string Keys()
 {
     AccessDB myObj = new AccessDB();
     myObj.SqlStr = "select Pass from TXL_Users where UserName='******'";
     OleDbDataReader myReader = myObj.ExecuteSqlStrReturnDr();
     if (myReader.Read())
     {
         return myReader["Pass"].ToString();
     }
     else
     {
         return "未知错误!";
     }
 }
Ejemplo n.º 5
0
 //检测账号是否存在
 public bool exit()
 {
     AccessDB myObj = new AccessDB();
     myObj.SqlStr = "select UserName from TXL_Users where UserName='******'";
     OleDbDataReader myReader = myObj.ExecuteSqlStrReturnDr();
     if (myReader.Read())
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Ejemplo n.º 6
0
 //查询ndt的ID
 public int ndtid()
 {
     AccessDB myObj = new AccessDB();
     myObj.SqlStr = "select ndt_id from CONSIGN_ndt where ndt_no='" + _ndt_no + "' and UserID=" + _UserID + "";
     OleDbDataReader myReader = myObj.ExecuteSqlStrReturnDr();
     if (myReader.Read())
     {
         return int.Parse(myReader["ndt_id"].ToString());
     }
     else
     {
         return -1;
     }
 }
Ejemplo n.º 7
0
 //返回所有记录的datareader
 public OleDbDataReader GetAllCONNDTDR(int ndt_id)
 {
     AccessDB myObj = new AccessDB();
     myObj.SqlStr = "select * from CONSIGN_ndt where ndt_id=" + ndt_id.ToString() + " order by ndt_name asc";
     OleDbDataReader myReader = myObj.ExecuteSqlStrReturnDr();//返回记录集
     return myReader;
 }
Ejemplo n.º 8
0
 //由con_id的到其他字段值
 public OleDbDataReader GetAllconndt()
 {
     AccessDB myObj = new AccessDB();
     myObj.SqlStr = "select * from CONSIGN_ndt where ndt_id=" + _ndt_id + "";
     OleDbDataReader myReader = myObj.ExecuteSqlStrReturnDr();
     return myReader;
 }
Ejemplo n.º 9
0
 //修改ndt委托
 public void Changndt()
 {
     AccessDB myObj = new AccessDB();
     myObj.SqlStr = "update [CONSIGN_ndt] set ndt_no='" + _ndt_no + "',ndt_wtrq='" + _ndt_wtrq + "',ndt_sjdw='" + _ndt_sjdw + "',ndt_wtr='" + _ndt_wtr + "',ndt_sjdwdz='" + _ndt_sjdwdz + "',ndt_tel='" + _ndt_tel + "',ndt_name='" + _ndt_name + "',ndt_jsdw='" + _ndt_jsdw + "',ndt_gcbh='" + _ndt_gcbh + "',ndt_fgcmc='" + _ndt_fgcmc + "',ndt_fgcbh='" + _ndt_fgcbh + "',ndt_gclb='" + _ndt_gclb + "',ndt_jjlx='" + _ndt_jjlx + "',ndt_jjgg='" + _ndt_jjgg + "',ndt_jjjb='" + _ndt_jjjb + "',ndt_cz='" + _ndt_cz + "',ndt_jcsj='" + _ndt_jcsj + "',ndt_hflx='" + _ndt_hflx + "',ndt_hjfs='" + _ndt_hjfs + "',ndt_pkxs='" + _ndt_pkxs + "',ndt_bmzl='" + _ndt_bmzl + "',ndt_jjcs='" + _ndt_jjcs + "',ndt_zjy='" + _ndt_zjy + "',ndt_jcxm='" + _ndt_jcxm + "',ndt_jcbz='" + _ndt_jcbz + "',ndt_hejb='" + _ndt_hejb + "',ndt_jcbi='" + _ndt_jcbi + "',ndt_jcsl='" + _ndt_jcsl + "',ndt_wcrq='" + _ndt_wcrq + "',ndt_sm='" + _ndt_sm + "',ndt_jsr='" + _ndt_jsr + "',ndt_jsrq='" + _ndt_jsrq + "' where ndt_id=" + _ndt_id + "";
     myObj.ExecuteSqlStr();
 }
Ejemplo n.º 10
0
 //添加NDT委托
 public void Addcon_ndt()
 {
     AccessDB myObj = new AccessDB();
     myObj.SqlStr = "insert into CONSIGN_ndt (UserID,ndt_no,ndt_wtrq,ndt_sjdw,ndt_wtr,ndt_sjdwdz,ndt_tel,ndt_name,ndt_jsdw,ndt_gcbh,ndt_fgcmc,ndt_fgcbh,ndt_gclb,ndt_jjlx,ndt_jjgg,ndt_jjjb,ndt_cz,ndt_jcsj,ndt_hflx,ndt_hjfs,ndt_pkxs,ndt_bmzl,ndt_jjcs,ndt_zjy,ndt_jcxm,ndt_jcbz,ndt_hejb,ndt_jcbi,ndt_jcsl,ndt_wcrq,ndt_sm,ndt_jsr,ndt_jsrq) values(" + 10 + ",'" + _ndt_no + "','" + _ndt_wtrq + "','" + _ndt_sjdw + "','" + _ndt_wtr + "','" + _ndt_sjdwdz + "','" + _ndt_tel + "','" + _ndt_name + "','" + _ndt_jsdw + "','" + _ndt_gcbh + "','" + _ndt_fgcmc + "','" + _ndt_fgcbh + "','" + _ndt_gclb + "','" + _ndt_jjlx + "','" + _ndt_jjgg + "','" + _ndt_jjjb + "','" + _ndt_cz + "','" + _ndt_jcsj + "','" + _ndt_hflx + "','" + _ndt_hjfs + "','" + _ndt_pkxs + "','" + _ndt_bmzl + "','" + _ndt_jjcs + "','" + _ndt_zjy + "','" + _ndt_jcxm + "','" + _ndt_jcbz + "','" + _ndt_hejb + "','" + _ndt_jcbi + "','" + _ndt_jcsl + "','" + _ndt_wcrq + "','" + _ndt_sm + "','" + _ndt_jsr + "','" + _ndt_jsrq + "')";
     myObj.ExecuteSqlStr();//确认插入数据
 }
Ejemplo n.º 11
0
 //添加分组
 public void Add()
 {
     AccessDB myObj = new AccessDB();
     myObj.SqlStr = "insert into TXL_Cats (UserID,catname) values(" + _userID + ",'" + _catName + "') ";
     myObj.ExecuteSqlStr();//确认插入数据
 }
Ejemplo n.º 12
0
 //找回密码
 public bool safe()
 {
     AccessDB myObj = new AccessDB();
     myObj.SqlStr = "select count(*) from TXL_Safe where UserName='******' and Question='" + _question + "' and Answer='" + _answer + "'";
     OleDbDataReader myReader = myObj.ExecuteSqlStrReturnDr();
     if (myReader.Read())
     {
         if (myReader[0].ToString() == "1")
             return true;
         else
             return false;
     }
     else
     {
         return false;
     }
 }
Ejemplo n.º 13
0
 //注册账号
 public void Add()
 {
     AccessDB myObj = new AccessDB();
     myObj.SqlStr = "insert into TXL_Safe (UserName,Question,Answer) values('" + _userName + "','" + _question + "','" + _answer + "') ";
     myObj.ExecuteSqlStr();//确认插入数据
 }
Ejemplo n.º 14
0
 //添加联系人
 public void AddPersons()
 {
     AccessDB myObj = new AccessDB();
     myObj.SqlStr = "insert into TXL_Persons (UserID,PersonName,PersonTel,PersonCel,PersonAddress,PersonQQ,CatId,Remark) values(" + _userID + ",'" + _name + "','" + _tel + "','"+_personCel+"','"+_address+"','" + _qq + "','" + _catId + "','"+_remark+"')";
     myObj.ExecuteSqlStr();//确认插入数据
 }
Ejemplo n.º 15
0
        //搜索联系人
        public OleDbDataReader Search()
        {
            AccessDB myObj = new AccessDB();

            //以下查询没实现···
            myObj.SqlStr = "select * from TXL_Persons where ((PersonName like '" + _personName + "*' and PersonTel like '" + _tel + "*' and PersonCel like '" + _personCel + "*') " +
                "or(PersonName like '" + _personName + "*' and PersonTel like '" + _tel + "*' and PersonCel is null)" +
                "or(PersonName like '" + _personName + "*'and PersonTel is null and PersonCel like '" + _personCel + "*')" +
                "or(PersonName is null and PersonTel like '" + _tel + "*' and PersonCel like '" + _personCel + "*')" +
                "or(PersonName like '" + _personName + "*' and PersonTel is null and PersonCel is null) " +
                "or(PersonName is null and PersonTel like '" + _tel + "*' and PersonCel is null)" +
                "or(PersonName is null and PersonTel is null and PersonCel like '" + _personCel + "*'))" +
                "and UserID=" + _userID + "";

            OleDbDataReader myReader = myObj.ExecuteSqlStrReturnDr();
            return myReader;
        }
Ejemplo n.º 16
0
 //得到person的id
 public OleDbDataReader GetPersonID()
 {
     AccessDB myObj = new AccessDB();
     //myObj.SqlStr = "select PersonID from TXL_Persons where PersonName='" + _name + "'and PersonTel='" + _tel + "'and PersonQQ='" + _qq + "'and CatId=" + _catId + " and UserID=" + _userID + "";
     myObj.SqlStr = "select PersonID from TXL_Persons where PersonName='" + _name + "' and CatId=" + _catId + " and UserID=" + _userID + "";
     OleDbDataReader myReader = myObj.ExecuteSqlStrReturnDr();//返回记录集
     return myReader;
 }
Ejemplo n.º 17
0
 //编辑分组名称
 public void Update()
 {
     AccessDB myObj = new AccessDB();
     myObj.SqlStr = "update TXL_Cats set catname='" + _catName + "' where UserID=" + _userID + " and CatId="+_catId+"";
     myObj.ExecuteSqlStr();//删除记录
 }
Ejemplo n.º 18
0
 //删除分组
 public void Delete()
 {
     AccessDB myObj = new AccessDB();
     myObj.SqlStr = "delete from TXL_Cats where CatName='" + _catName.ToString() + "' and UserID=" + _userID + "";
     myObj.ExecuteSqlStr();//删除记录
 }
Ejemplo n.º 19
0
 //查询分组ID
 public int CatIds()
 {
     AccessDB myObj = new AccessDB();
     myObj.SqlStr = "select CatId from TXL_Cats where CatName='" + _catName + "' and UserID="+_userID+"";
     OleDbDataReader myReader = myObj.ExecuteSqlStrReturnDr();
     if (myReader.Read())
     {
         return int.Parse(myReader["CatId"].ToString());
     }
     else
     {
         return -1;
     }
 }
Ejemplo n.º 20
0
 //删除联系人
 public void DeletePerson()
 {
     AccessDB myObj = new AccessDB();
     myObj.SqlStr = "delete TXL_Persons from TXL_Persons where PersonID=" + _personID + "";
     myObj.ExecuteSqlStr();//删除数据
 }
Ejemplo n.º 21
0
 //添加工程编号
 public void Addndtno()
 {
     AccessDB myObj = new AccessDB();
     myObj.SqlStr = "insert into CONSIGN_ndt (UserID,ndt_no) values(" + _UserID + ",'" + _ndt_no + "') ";
     myObj.ExecuteSqlStr();//确认插入数据
 }
Ejemplo n.º 22
0
 //返回所有分类//增加了集合的操作/集合copyto array
 public ArrayList GetAllTXLCats()
 {
     ArrayList tmpList = new ArrayList();
     AccessDB myObj = new AccessDB();
     myObj.SqlStr = "select * from TXL_Cats order by catname asc where UserID=" + _userID + "";
     OleDbDataReader myReader = myObj.ExecuteSqlStrReturnDr();//返回记录集
     while (myReader.Read())
     {
         tmpList.Add(myReader["catname"].ToString());
     }
     myReader.Close();
     return tmpList;
 }
Ejemplo n.º 23
0
 //删除工程
 public void Deletendt()
 {
     AccessDB myObj = new AccessDB();
     myObj.SqlStr = "delete from CONSIGN_ndt where ndt_no='" + _ndt_no + "' and UserID=" + _UserID + "";
     myObj.ExecuteSqlStr();//删除记录
 }
Ejemplo n.º 24
0
 //返回所有Cats记录的datareader
 public OleDbDataReader GetAllTXLCatsDR()
 {
     AccessDB myObj = new AccessDB();
     myObj.SqlStr = "select * from TXL_Cats  where UserID=" + _userID + " order by catname asc";
     OleDbDataReader myReader = myObj.ExecuteSqlStrReturnDr();//返回记录集
     return myReader;
 }
Ejemplo n.º 25
0
 //返回所有ndt记录的datareader
 public OleDbDataReader GetAllCONNDTDR()
 {
     AccessDB myObj = new AccessDB();
     myObj.SqlStr = "select * from CONSIGN_ndt  where UserID=" + _UserID + " order by ndt_no asc";
     OleDbDataReader myReader = myObj.ExecuteSqlStrReturnDr();//返回记录集
     return myReader;
 }
Ejemplo n.º 26
0
        //返回所有记录的dataset
        public DataSet GetAllTXLCatsDS()
        {
            AccessDB myObj = new AccessDB();
            myObj.SqlStr = "select * from TXL_Cats  where UserID=" + _userID + " order by catname asc";

            return myObj.ExecuteSqlStrReturnDs();
        }
Ejemplo n.º 27
0
 //由ndt_Id得到ndt_no的值
 public string Getndtno()
 {
     AccessDB myObj = new AccessDB();
     myObj.SqlStr = "select ndt_no from CONSIGN_ndt where ndt_id=" + _ndt_id + "";
     OleDbDataReader myReader = myObj.ExecuteSqlStrReturnDr();
     if (myReader.Read())
     {
         return myReader["ndt_no"].ToString();
     }
     else
     {
         return null;
     }
 }
Ejemplo n.º 28
0
 //得到最大的ID号
 public int GetMAXId()
 {
     AccessDB myObj = new AccessDB();
     myObj.SqlStr = "select top 1 catid from TXL_Cats  where UserID=" + _userID + " order by catid desc";
     OleDbDataReader myReader = myObj.ExecuteSqlStrReturnDr();//返回记录集
     if (myReader.Read())
         return int.Parse(myReader["catid"].ToString());
     else
         return -1;
 }
Ejemplo n.º 29
0
 //编辑工程编号
 public void Updatendtno()
 {
     AccessDB myObj = new AccessDB();
     myObj.SqlStr = "update CONSIGN_ndt set ndt_no='" + _ndt_no + "' where UserID=" + _UserID + " and ndt_id=" + _ndt_id + "";
     myObj.ExecuteSqlStr();//删除记录
 }
Ejemplo n.º 30
0
 //单条记录
 public void GetModel()
 {
     AccessDB myObj = new AccessDB();
     myObj.SqlStr = "select * from TXL_Cats where catid='" + _catId.ToString() + "' and UserID=" + _userID + "";
     OleDbDataReader myReader = myObj.ExecuteSqlStrReturnDr();//返回记录集
     if (myReader.Read())
     {
         _catName = myReader["catname"].ToString();
     }
     myReader.Close();
 }