示例#1
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public void Add(UserPermission.Model.USER_SHARE_ACCOUNTMODEL model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into USER_SHARE_ACCOUNT(");
            strSql.Append("ACCOUNTID,ACCOUNTNAME,COMPANYID,ACCOUNTPWD,ORIGNALPWD,REALNAME,EMAIL,ROLEIDS,LINKPHONE,CREATEDATE,CREATORID,ISADMIN,STATUS)");

            strSql.Append(" values (");
            strSql.Append("@ACCOUNTID,@ACCOUNTNAME,@COMPANYID,@ACCOUNTPWD,@ORIGNALPWD,@REALNAME,@EMAIL,@ROLEIDS,@LINKPHONE,@CREATEDATE,@CREATORID,@ISADMIN,@STATUS)");
            Database  db        = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());

            db.AddInParameter(dbCommand, "ACCOUNTID", DbType.String, model.ACCOUNTID);
            db.AddInParameter(dbCommand, "ACCOUNTNAME", DbType.String, model.ACCOUNTNAME);
            db.AddInParameter(dbCommand, "COMPANYID", DbType.String, model.COMPANYID);
            db.AddInParameter(dbCommand, "ACCOUNTPWD", DbType.String, model.ACCOUNTPWD);
            db.AddInParameter(dbCommand, "ORIGNALPWD", DbType.String, model.ORIGNALPWD);
            db.AddInParameter(dbCommand, "REALNAME", DbType.String, model.REALNAME);
            db.AddInParameter(dbCommand, "EMAIL", DbType.String, model.EMAIL);
            db.AddInParameter(dbCommand, "ROLEIDS", DbType.String, model.ROLEIDS);
            db.AddInParameter(dbCommand, "LINKPHONE", DbType.String, model.LINKPHONE);
            db.AddInParameter(dbCommand, "CREATEDATE", DbType.String, model.CREATEDATE);
            db.AddInParameter(dbCommand, "CREATORID", DbType.String, model.CREATORID);
            db.AddInParameter(dbCommand, "ISADMIN", DbType.String, model.ISADMIN);
            db.AddInParameter(dbCommand, "STATUS", DbType.String, model.STATUS);
            db.ExecuteNonQuery(dbCommand);
        }
示例#2
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public void Update(UserPermission.Model.USER_SHARE_ACCOUNTMODEL model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update USER_SHARE_ACCOUNT set ");
            strSql.Append("ACCOUNTNAME=@ACCOUNTNAME,");
            strSql.Append("COMPANYID=@COMPANYID,");
            strSql.Append("ACCOUNTPWD=@ACCOUNTPWD,");
            strSql.Append("ORIGNALPWD=@ORIGNALPWD,");
            strSql.Append("REALNAME=@REALNAME,");
            strSql.Append("EMAIL=@EMAIL,");
            strSql.Append("ROLEIDS=@ROLEIDS,");
            strSql.Append("LINKPHONE=@LINKPHONE,");
            strSql.Append("CREATEDATE=@CREATEDATE,");
            strSql.Append("CREATORID=@CREATORID,");
            strSql.Append("ISADMIN=@ISADMIN,");
            strSql.Append("STATUS=@STATUS");
            strSql.Append(" where ACCOUNTID=@ACCOUNTID ");
            Database  db        = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());

            db.AddInParameter(dbCommand, "ACCOUNTID", DbType.String, model.ACCOUNTID);
            db.AddInParameter(dbCommand, "ACCOUNTNAME", DbType.String, model.ACCOUNTNAME);
            db.AddInParameter(dbCommand, "COMPANYID", DbType.String, model.COMPANYID);
            db.AddInParameter(dbCommand, "ACCOUNTPWD", DbType.String, model.ACCOUNTPWD);
            db.AddInParameter(dbCommand, "ORIGNALPWD", DbType.String, model.ORIGNALPWD);
            db.AddInParameter(dbCommand, "REALNAME", DbType.String, model.REALNAME);
            db.AddInParameter(dbCommand, "EMAIL", DbType.String, model.EMAIL);
            db.AddInParameter(dbCommand, "ROLEIDS", DbType.String, model.ROLEIDS);
            db.AddInParameter(dbCommand, "LINKPHONE", DbType.String, model.LINKPHONE);
            db.AddInParameter(dbCommand, "CREATEDATE", DbType.String, model.CREATEDATE);
            db.AddInParameter(dbCommand, "CREATORID", DbType.String, model.CREATORID);
            db.AddInParameter(dbCommand, "ISADMIN", DbType.String, model.ISADMIN);
            db.AddInParameter(dbCommand, "STATUS", DbType.String, model.STATUS);
            db.ExecuteNonQuery(dbCommand);
        }