Example #1
0
        /// <summary>
        /// 对订单管理员数据的修改
        /// </summary>
        /// <param name=></param>
        /// <returns></returns>
        public bool AlterOAInfo()
        {
            OA OAdmin = new OA();

            string sqlstring = "update Admin set TrueName=N'" + this.TrueName + "',IdCardNum='" + this.IdCardNum + "',PassWord='******'where UserName =N'" + this.UserName + "'";

            if (SqlHelper.ExecuteNonQuery(sqlstring) > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #2
0
        /// <summary>
        /// 数据读取并赋值给对象的共有属性
        /// </summary>
        /// <param name="UserName"></param>
        /// <returns>OAdmin</returns>
        public OA OAInfoRead()
        {
            OA     OAdmin     = new OA();
            string sqlstring1 = "select StaffID,Password,TrueName,StaffType,AddTime,UserName,IdCardNum from Admin where UserName='******'";

            SqlHelper.ReadDateReadBegin(sqlstring1);
            while (SqlHelper.SqlReader.Read())
            {
                OAdmin.StaffID   = Convert.ToInt32(SqlHelper.SqlReader["StaffID"]);
                OAdmin.PassWord  = SqlHelper.SqlReader["PassWord"].ToString();
                OAdmin.TrueName  = SqlHelper.SqlReader["TrueName"].ToString();
                OAdmin.StaffType = Convert.ToChar(SqlHelper.SqlReader["StaffType"]);
                OAdmin.AddTime   = SqlHelper.SqlReader["AddTime"].ToString();
                OAdmin.IdCardNum = SqlHelper.SqlReader["IdCardNum"].ToString();
            }
            SqlHelper.ReadDateReadEnd();


            return(OAdmin);
        }