public int Insert(CompanyModel.UserInfo model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into UserInfo("); strSql.Append("username,PassWord,CreateTime,UpdateTime,UsedNums,LastLoginTime,Status,Types)"); strSql.Append(" values ("); strSql.Append("@username,@PassWord,@CreateTime,@UpdateTime,@UsedNums,@LastLoginTime,@Status,@Types)"); strSql.Append(";select @@IDENTITY"); return(DBHelper.ExecuteSql(strSql.ToString(), model)); }
public int Update(CompanyModel.UserInfo model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update UserInfo set "); strSql.Append("username=@username,"); strSql.Append("UserNums=@UserNums,"); strSql.Append("PassWord=@PassWord,"); strSql.Append("CreateTime=@CreateTime,"); strSql.Append("UpdateTime=@UpdateTime,"); strSql.Append("LastLoginTime=@LastLoginTime,"); strSql.Append("Status=@Status,"); strSql.Append("Types=@Types"); strSql.Append(" where id=@id"); return(DBHelper.ExecuteSql(strSql.ToString(), model)); }